Jul 26, 2008

How To Use Win32api Via Php

Free Web Hosting, No Ads > CONTRIBUTE > Computers > Programming Languages > PHP Programming

free web hosting

How To Use Win32api Via Php

LuciferStar
I found these codes,but doesn't work well.
Does anyone know howto?

Thanks!
CODE
<?php
// Define constants needed, taken from
// Visual Studio/Tools/Winapi/WIN32API.txt
define("MB_OK", 0);

// Load the extension in
dl("php_w32api.dll");

// Register the GetTickCount function from kernel32.dll
w32api_register_function("kernel32.dll",
                        "GetTickCount",
                        "long");
                       
// Register the MessageBoxA function from User32.dll
w32api_register_function("User32.dll",
                        "MessageBoxA",
                        "long");

// Get uptime information
$ticks = GetTickCount();

// Convert it to a nicely displayable text
$secs  = floor($ticks / 1000);
$mins  = floor($secs / 60);
$hours = floor($mins / 60);

$str = sprintf("You have been using your computer for:".
               "\r\n %d Milliseconds, or \r\n %d Seconds".
               "or \r\n %d mins or\r\n %d hours %d mins.",
               $ticks,
               $secs,
               $mins,
               $hours,
               $mins - ($hours*60));

// Display a message box with only an OK button and the uptime text
MessageBoxA(NULL,
           $str,
           "Uptime Information",
           MB_OK);
?>

 

 

 


Reply

Lary
QUOTE
<?php
// Define constants needed, taken from
// Visual Studio/Tools/Winapi/WIN32API.txt
define("MB_OK", 0);

// Load the extension in
dl("php_w32api.dll");

// Register the GetTickCount function from kernel32.dll
w32api_register_function("kernel32.dll",
                        "GetTickCount",
                        "long");
                       
// Register the MessageBoxA function from User32.dll
w32api_register_function("User32.dll",
                        "MessageBoxA",
                        "long");

// Get uptime information
$ticks = GetTickCount();

// Convert it to a nicely displayable text
$secs  = floor($ticks / 1000);
$mins  = floor($secs / 60);
$hours = floor($mins / 60);

$str = sprintf("You have been using your computer for:".
               "\r\n %d Milliseconds, or \r\n %d Seconds".
               "or \r\n %d mins or\r\n %d hours %d mins.",
               $ticks,
               $secs,
               $mins,
               $hours,
               $mins - ($hours*60));

// Display a message box with only an OK button and the uptime text
MessageBoxA(NULL,
           $str,
           "Uptime Information",
           MB_OK);
?>


You can't Use Win32api Via Php for creating internet sites... I think it can be used onley with Active-x dll or Active-x controls in your visual studio, but not for web pages...

 

 

 


Reply



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.
Confirm Code:

Recent Queries:-
  1. php gettickcount - 97.67 hr back. (1)
  2. php_w32api.dll - 17.68 hr back. (4)
  3. php win32 api - 5.46 hr back. (2)
  4. w32api_register_function not working - 175.80 hr back. (1)
  5. win32 api php - 178.99 hr back. (1)
Similar Topics

Keywords : win32api php


    Looking for win32api, php

Searching Video's for win32api, php
advertisement



How To Use Win32api Via Php



 

 

 

 

ADD REPLY / Got an Opinion! Remove these ADs! RAPID SEARCH! Free Web Hosting [X]
Express your Opinions, Thoughts or Contribute more info. to help others.
Ask your Doubts & Queries to get answers, So that "Together We can help others!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE