Hello
Hello,
I want to take screenshots of my application in a automatic way, it work fine until I need to show a PopupMenu...the popup() method is blocking the code.
How can I show a PopupMenu, take a screenshot and close the menu to continue the execution of my automatic code ?
Note that the code is in the application, I create forms, set controls properties, take a photo, etc...so I can handle error conditions very easly...but I can't figure how to display a popupmenu.
I want to take screenshots of my application in a automatic way, it work fine until I need to show a PopupMenu...the popup() method is blocking the code.
How can I show a PopupMenu, take a screenshot and close the menu to continue the execution of my automatic code ?
Note that the code is in the application, I create forms, set controls properties, take a photo, etc...so I can handle error conditions very easly...but I can't figure how to display a popupmenu.
YEs ! I've put the screenshot in a Thread...but Winapi.Windows.EndMenu do not close the menu...probably because I'm not in the same thread...
ReplyDeleteFillChar(GTI, SizeOf(GTI), 0);
ReplyDeleteGTI.cbSize := SizeOf(GTI);
GetGUIThreadInfo(0, GTI);
SendMessage(GTI.hwndCapture, WM_CANCELMODE, 0, 0);
:)
Tu parles tout seul on dirait...
ReplyDeleteI often find the answer to my question just after asking :)
ReplyDeleteQuestion often contains the answer. It s always a pleasure to read your posts.
ReplyDeletePaul TOTH What about calling EndMenu in the OnTerminate event of the thread?
ReplyDeleteUwe Raabe didn't try, and I'm already very late on my project :)
ReplyDeletePaul TOTH That is called rubber duck debugging: https://en.wikipedia.org/wiki/Rubber_duck_debugging
ReplyDeleteStefan Glienke I thought it was talent :)
ReplyDeleteStefan Glienke My first time heard about it, and I had similar experiences several times too!
ReplyDeleteEdwin Yip It is a skill that every professional developer should have as it improves the problem finding and solving process significantly.
ReplyDeleteStefan Glienke Yes, I guess it works because languages refine our thinking process.
ReplyDeleteSerendipity is a good skills too
ReplyDeleteThinking aloud sometimes helps. Teddybear debugging too, where you explain the problem to your favorite stuffed toy.
ReplyDelete