window

having handle to a menu (HMENU) is it possible to find it's parent window (HWND)?

耗尽温柔 提交于 2019-12-23 02:17:57
问题 I know about the option for system menu, that is the alt+space one. And it's not pretty it involves looping all open windows through GetNextWindow . But I want to ask in more general way. That is having any menu handle, not necessarily to system menu (that is easy to find for any window) is it possible to get to its parent window ? 回答1: In the particular case when hmenu obtained on the fly from an existing menu-window (class #32768): you can use GUITHREADINFO.hwndMenuOwner via

Checking if clicks are within a graphic object [Python Graphics Module]

大憨熊 提交于 2019-12-23 01:46:10
问题 Here is the module I'm using: http://mcsp.wartburg.edu/zelle/python/graphics/graphics.pdf I want to see whether a user's clicks are within a shape or not. I used the in operator, but I know that is incorrect. Below is a chunk of my code: win = GraphWin("Click Speed", 700, 700) theTarget = drawTarget(win, random.randrange(0,685), random.randrange(0,685)) while theTarget in win: click = win.getMouse() if click in theTarget: print("Good job") I left out the code that draws theTarget shape

(Windows API) WM_PAINT Mouse problems

强颜欢笑 提交于 2019-12-23 01:11:25
问题 I created a window with the following flags to overlay a d3d application: WS_EX_TOPMOST | WS_EX_COMPOSITED | WS_EX_TRANSPARENT | WS_EX_LAYERED I proceeded with colorkeying the window for transperacy and all worked well. However once I began drawing on it using GDI an unforeseen problem occurred: For some reason the mouse events (especially movement) are not passed correctly through the window when WM_PAINT is in progress, and so it appears as though the mouse and the keyboard for that matter

Presto SQL window aggregate looking back x hours/minutes/seconds

…衆ロ難τιáo~ 提交于 2019-12-23 01:03:36
问题 I want to do aggregate on presto sql by looking back x hours/minutes/seconds ago. Data id | timestamp | status ------------------------------------------- A | 2018-01-01 03:00:00 | GOOD A | 2018-01-01 04:00:00 | BAD A | 2018-01-01 05:00:00 | GOOD A | 2018-01-01 09:00:00 | BAD A | 2018-01-01 09:15:00 | BAD A | 2018-01-01 13:00:00 | GOOD A | 2018-01-01 14:00:00 | GOOD B | 2018-02-01 09:00:00 | GOOD B | 2018-02-01 10:00:00 | BAD Results: id | timestamp | status | bad_status_count ---------------

Detect window closed

左心房为你撑大大i 提交于 2019-12-22 16:32:23
问题 I'm creating a chat client which uses a database to check the status of a session 0-waiting, 1-running, 2-closed. I have a close button which will change the status to 2 but I was wondering, how do I detect if the browser is closed just by pressing x? The main reason for this is I don't want the session showing up as running when one of the participants has closed their browser. 回答1: use the unload and onbeforeunload events: window.onunload = window.onbeforeunload = function (){...}; It's

Restoring a window after waiting for a process to exit in VB6

拥有回忆 提交于 2019-12-22 11:11:41
问题 I am using VB6 in win7 64bit OS. This application is migrated from xp.. Me.WindowState = vbMinimized WaitForProcess Shell(launchapp, vbNormalFocus) Me.WindowState = vbNormal Before launching the launchapp, my code minimizes the main application and will launch an exe. Once the exe is closed by the user, my main application has to come back from minimized state to normal. This works fine in xp, but in win 7 my main app which is minimized just flashes and goes back to minimized state again. Any

.NET (C#) Window Minimize Event

£可爱£侵袭症+ 提交于 2019-12-22 10:38:24
问题 Hey, I'm really stuck with my project here... I need to know when any open window has been minimized / restored and Handle the event in my own App. Any ideas? Edit: Musigenesis is right, i do want to know when OTHER applications are minimized/restored 回答1: I think you would need to use the SetWindowsHookEx Win32 API function (along with a few others). Basically, you would iterate through all open windows in the OS and hook into their resizing events. Obligatory comment: are you sure you need

How can I make the compilation log create a new window in Emacs?

做~自己de王妃 提交于 2019-12-22 08:30:16
问题 If I only have one window showing in emacs and use M-x compile, the window splits in two and I can watch the compile buffer easily. However, if I have more windows showing, the compilation log takes over one of the others, which I find irritating. How can I make emacs always split a new window to show the compilation log? Edit: A bit more information from my reading that I've been doing. It looks like compile.el calls display-buffer, which only splits a window if it is current full width. Is

automatic open pop-up new window using Javascript [duplicate]

依然范特西╮ 提交于 2019-12-22 06:57:03
问题 This question already has an answer here : window.open not working when attached on onload event in chrome and safari [duplicate] (1 answer) Closed 12 months ago . How to open pop-up new window when load page using Javascript? I want, when a website load, it will automatic open popup new window. I use the following: <script type="text/javascript"> function open_on_entrance(url,name) { window.open('http://www.google.com','google', ' menubar,resizable,dependent,status,width=300,height=200,left

How to dock a windows form in C#?

谁都会走 提交于 2019-12-22 05:51:32
问题 I just would like to know if it is possible to dock a windows form on top of the user screen? I have been trying to do this by manually setting the position of my form to the coordinates I want. But using this method, however, allows the user to change the position of the form just by dragging it. I want to make the form docked to the upper portion of the screen since this window form will server as a menu for the project I am making. Thanks a lot. :) 回答1: I would consider using the Control