• 26 May 2013 - Since the new version attracted too many spammy registrations (around 250 fake accounts/day), user registrations are now protected by Mollom's spam protection service. Contact us if this causes some trouble.
  • 01 May 2013 - After the site upgrade, all passwords were reset and you will need to ask the site for a login reset on your first connection.

Maximize application window

Warning: this tip is only for Win32 versions of PHP-GTK.

<?php
if (!extension_loaded('gtk')) {
 
dl( 'php_gtk.' . PHP_SHLIB_SUFFIX);
 
dl("php_w32api.dll");
}

// start windows api class
$api = &new win32;

// defines
define('SW_MAXIMIZE',3);
define('SW_MINIMIZE',6);

//register window functions
$api->registerfunction(
 
"long GetLastError
    Alias GetError ()
    From kernel32.dll"
);
$api->registerfunction(
 
"long FindWindow
  (string &ClassName, string &WindowName)
  From user32.dll"
);
$api->registerfunction(
 
"long ShowWindow
  (long hWnd, long nCmdShow)
  From user32.dll"
);

// gtk shutdown function
function shutdown() {
 
Gtk::main_quit();
}

//main window
$window = &new GtkWindow();
$window->set_title('PHP Test');
$window->set_policy(TRUE, TRUE, FALSE);
$window->connect('destroy', 'shutdown');
$window->show();
$class_string = 'gdkWindowToplevel';
$title_string = 'PHP Test';
if (!
$sw = $api->FindWindow($class_string,$title_string)) {
 
$error = $api->getError();
  echo
' Oops FindWindow error: '.$error."\n";
} else {
 
$api->ShowWindow($sw,SW_MAXIMIZE);
  }
Gtk::main();
?>