Fullscreen with task bar

I like maximizing screen estate just as much as the next guy, but some things are just useful to have on-screen at all time. Like the Windows Task Bar for example. Most fullscreen-modes of software hide the task bar, however. This might be preferred sometimes, but when it’s not, change it!
The following C++ code uses the Windows API (formerly win32 API) to change the size of an Internet Explorer window (which will reveal the task bar when the window was in fullscreen-mode).

#include <stdio.h>
#include <Windows.h>
int WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR lpCmdLine,int nCmdShow){
   HWND lHwnd = FindWindow("IEFrame", NULL);
   MoveWindow(lHwnd,0,0,1280,770,TRUE);
   return 0;
}

Above code is quite crude, as the window name and desired window size are hard-coded in. ‘IEFrame’ is the name of an IE7 window (probably works for older/newer versions as well). My monitor’s resolution is 1280 × 800 and the task bar is 30 pixels high, which leads to the 1280 and 770 parameters.
If you want to change the code to target other programs, you’ll need to do some Googling for yourself (if you ask nicely in the comments, I might do it for you!). Remember that you need the Windows API (comes with the Microsoft Platform SDK) to compile, though.
 
A compiled version of the code above can be downloaded from here.
Advertisements
This entry was posted in Computers en internet. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s