Win7 Chrome process handle question

97 views
Skip to first unread message

Jamal Yusuf

unread,
May 29, 2015, 1:02:12 PM5/29/15
to chromi...@chromium.org
Fairly new to these forums, apologies if this is the wrong section.

I've been scratching my head about an issue for a few days, I'm trying to use the win32 setWindowPos function to resize+reposition the google chrome window. So far it doesn't work, maybe I'm getting the wrong handle, if I understand the chrome process setup - each tab gets a new process and each process has its own handle? The code I'm using to find the chrome handle is the following:


C++ code: 

HWND handle = FindWindow(TEXT("Chrome_WidgetWin_1"),NULL);

I'm then passing that handle as an argument to setWindowPos

SetWindowPos(handle, HWND_TOPMOST, 0, 0, iwidth, iheight, SWP_NOMOVE | SWP_SHOWWINDOW);


Doing the above with any other program gives me a resized window that is in focus. Doing that with the chrome handle does nothing. If possible can someone suggest reading material that explains how to get the proper handle(hwnd)? Or suggest some pseudo code that can point me in the right direction? 

Scott Graham

unread,
May 29, 2015, 1:15:09 PM5/29/15
to hassanja...@gmail.com, chromium-dev
This is a generic Windows programming question, not a Chrome development one, so please try somewhere like StackOverflow.

(That should work fine. Did you check the return value from SWP? Confirm that FindWindow is returning the same value that Spy++ shows for the top level window.)

--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev

Reply all
Reply to author
Forward
0 new messages