|
-
Mar 15th, 2009, 07:49 PM
#1
Re: Launch a program and set its size
Adobe windows probably have a set class name for their windows. If this is true, after you shell the .pdf file, you can use FindWindow to locate the Adobe window (taking into consideration for a second or two or three) for it to open. There are other ways too: Using shellexecute, you can create a process for the .pdf to run in, and since you know its PID (process ID), you can locate the specific file you launched by using the GetWindowThreadProcessID api. This will come in handy if there are more than one Adobe windows opened at the same time. There are many posted examples on how to get the hWnd from a PID.
Anyway, once you get the hWnd, you can now have far more control. Here are some options
1. Easiest, but not really recommended: Use SetParent API and place the Adobe window directly onto your form. That way it cannot be hidden behind your fullscreen form.
2. Set the Adobe window to be top most, that way if someone clicks on your form by mistake, it won't go behind your form. Of course, now you need to move and or size it to exactly where you want: SetWndowPos or MoveWindow
Here is one possible gotcha. I don't use Adobe too often, but I do notice that sometimes it pops up with another window that asks if I want to upgrade or not, or download a patch or not. This window may or may not cause you some problems if and when it does pop up.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|