Code:
//Main handle to AD Pictures
HWND myTitle = FindWindowTitleContains("AD Pictures by Exclaimer");
HWND myClass = FindWindowClassContains("#32770");
HWND application = FindWindow("#32770", "AD Pictures by Exclaimer");
//Next button
HWND nextButton = FindWindow("Button", "&Next >");
//Import Multiple Pictures
HWND radio1 = FindWindow("Button", "Import Multiple Images");
//Handle for the SysTreeView32 Form
HWND TreeView = FindWindowEx(myClass, NULL, "SysTreeView32", NULL);
//Start our application "AD Pictures"
ShellExecute(NULL, "open", "c:\\Program Files\\AD Pictures\\AD Pictures.exe", NULL, NULL, SW_SHOWNORMAL);
if(application)
{
//MessageBox(0, "TestZZZ", "Found Window", MB_OK);
if(nextButton)
{
MessageBox(0, "Test1", "Found Window", MB_OK);
SendMessage(nextButton, BM_CLICK, 0, 0);
}
else if(radio1)
{
MessageBox(0, "Test2", "Found Window", MB_OK);
SendMessage(radio1, BM_CLICK, 0, 0);
SendMessage(nextButton, BM_CLICK, 0, 0);
}
else if(TreeView)
{
MessageBox(0, "Test3", "Found Window", MB_OK);
treeItem = SendMessage(TreeView, TVM_GETNEXTITEM, TVGN_ROOT, 0);
treeItem = SendMessage(TreeView, TVM_GETNEXTITEM, TVGN_NEXT, treeItem);
treeItem = SendMessage(TreeView, TVM_GETNEXTITEM, TVGN_CHILD, treeItem);
SendMessage(TreeView, TVM_SELECTITEM, TVGN_CARET, treeItem);
}
}
Does this look correct? It doesn't seem to be emulating anything for me.