#include <windows.h>
#include <commctrl.h>
int WINAPI WinMain (HINSTANCE hThisInstance,
HINSTANCE hPrevInstance,
LPSTR lpszArgument,
int nFunsterStil)
{
HWND Vent = FindWindow( NULL, "Ventrilo" );//parent most window
HWND Tree = FindWindowEx( Vent, NULL, "SysTreeView32", NULL );//this is the
//treeview
if( !Tree )
{
MessageBox( NULL, "Tree: Failed", "Error", MB_OK );
return 0;
}
POINT FinalPos;
FinalPos.x = 35;//this is the hard coded position of the username(relative
FinalPos.y = 24;//to the window)
int Param = MAKELPARAM( (short)FinalPos.x, (short)FinalPos.y );
SendMessage( Tree, WM_RBUTTONDOWN, VK_RBUTTON, Param );
SendMessage( Tree, WM_RBUTTONUP, 0, Param );
}
Windows message Hell
Hello, lately ive been working on a "plug-in" for a program called Ventrilo(voice-chat). Heres the situation. There is a Treeview of a bunch of usernames(Clicky), and if you right click on these usernames, a drop-down list will pop up with a bunch of possible options(mute, etc). Well, im trying to simulate right-clicking on one of these usernames so the drop-down window will pop up. It seems like ive tried endless combinations of Windows messages, sifting through spy++ for and hints, but no luck.
Right now, all it does is highlight the username, as if i have left clicked on it.
Any ideas?
thanks a bunch.
Try sending it to the main message queue
Edit:
That has some quirks, it would pop up the menu wherever your mouse is, so you need to move the mouse (if you want..)
SendMessage( Vent, WM_RBUTTONDOWN, VK_RBUTTON, Param ); SendMessage( Vent, WM_RBUTTONUP, 0, Param );
Edit:
That has some quirks, it would pop up the menu wherever your mouse is, so you need to move the mouse (if you want..)
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement