James
2008-05-14 22:00:32 UTC
Hi There,
Is it possible to programmatically move the Windows Tas
I've been attempting to write a simple C program that is capable of moving
the TaskBar in Windows.
So far, I've stumple upon the ShellAPI function "SHAppBarMessage". I've
attempted to use it,
but nothing is happening to my taskbar at all. Please see below for my full
code.
Can someone help?
Regards,
Jr
#include <stdio.h>
#include <windows.h>
#include <shellapi.h>
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR
lpCmdLine, int nShowCmd)
{
HWND hWnd = FindWindow("Shell_TrayWnd", NULL);
APPBARDATA abd;
ZeroMemory(&abd, sizeof(abd));
abd.cbSize = sizeof(APPBARDATA);
SHAppBarMessage(ABM_GETTASKBARPOS, &abd);
abd.rc.top = 300;
abd.uEdge = ABE_RIGHT;
SHAppBarMessage(ABM_SETPOS, &abd);
MessageBox(NULL, "Done!", "Taskbar Refresh", MB_OK);
return 0;
}
Is it possible to programmatically move the Windows Tas
I've been attempting to write a simple C program that is capable of moving
the TaskBar in Windows.
So far, I've stumple upon the ShellAPI function "SHAppBarMessage". I've
attempted to use it,
but nothing is happening to my taskbar at all. Please see below for my full
code.
Can someone help?
Regards,
Jr
#include <stdio.h>
#include <windows.h>
#include <shellapi.h>
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR
lpCmdLine, int nShowCmd)
{
HWND hWnd = FindWindow("Shell_TrayWnd", NULL);
APPBARDATA abd;
ZeroMemory(&abd, sizeof(abd));
abd.cbSize = sizeof(APPBARDATA);
SHAppBarMessage(ABM_GETTASKBARPOS, &abd);
abd.rc.top = 300;
abd.uEdge = ABE_RIGHT;
SHAppBarMessage(ABM_SETPOS, &abd);
MessageBox(NULL, "Done!", "Taskbar Refresh", MB_OK);
return 0;
}