Active Forums => Programs => Topic started by: Dav on December 11, 2020, 07:09:36 pm
Title: Maximize a minimized program anytime using WinAPI
Post by: Dav on December 11, 2020, 07:09:36 pm
I needed to make a minimized program to wake up and maximize when completing a task. Couldn't remember if QB64 had a command to do it (I know it has a minimize command,_SCREENICON), so I used a WindowAPI - OpenIcon. This will maximize and active the program window when called. With this you can prevent a program from ever being minimized, and forever stay in your face and nag you like a bad wife.
I couldn't get _SCREENSHOW to maximize for me here - perhaps I'm not calling it right though. I tried adding the metacommand and did a _SCREENHIDE first, but _SCREENSHOW didn't max. I'm on Win7 32 bit, if OS matters.
- Dav
Title: Re: Maximize a minimized program anytime using WinAPI
Post by: FellippeHeitor on December 12, 2020, 09:43:36 am
Screen show will only make the window visible again after screen hide. Nothing to do with screen icon.
Title: Re: Maximize a minimized program anytime using WinAPI
Post by: Dav on December 12, 2020, 10:29:29 am
@Petr, the screen recorder sounds interesting. Looking forward to seeing that.
- Dav
Title: Re: Maximize a minimized program anytime using WinAPI
Post by: Petr on December 12, 2020, 10:42:50 am
Dav, my ScreenRecorder is already somwhere on the forum, in order for _SCREENIMAGE to provide the current image (for example, when saving a video from Youtube), the program must be minimized. I think (it's been a long time since I wrote it and then left it aside) that there was probably a problem with the control, when minimized, I think it stopped responding to the keyboard and mouse. But it's been a long time. I will deal with it next year, first I will complete the program with a Christmas theme. Of course, what I would also like, and maybe SpriggsySpriggs could do, would be to record the sound of the current audio stream. But that is again a question of the future... :)
Title: Re: Maximize a minimized program anytime using WinAPI
Post by: Dav on December 12, 2020, 11:24:54 am
@Petr: I have't done any audio recording using API yet, but I can look into it. Maybe SpriggsySpriggs has already worked that up though - he's been pumping out a lot of great API code lately!
- Dav
Title: Re: Maximize a minimized program anytime using WinAPI
Post by: SpriggsySpriggs on December 14, 2020, 09:10:23 am
I do have code that does webcam capturing and I have code for recording audio with WinAPI. Both were fairly difficult and both are in my API collection. The webcam one works but I'm sure it could be done even better. As a matter of fact, one could use a virtual webcam software to pipe the desktop into the webcam capturing code I wrote and still record the desktop. Not sure about how the compression will be, though.
Title: Re: Maximize a minimized program anytime using WinAPI
Post by: Dav on December 14, 2020, 09:19:33 am
Cool. I'm gonna re-download and take a closer look at your API collection.
- Dav
Title: Re: Maximize a minimized program anytime using WinAPI
Post by: SpriggsySpriggs on December 14, 2020, 09:20:27 am
Actually, I have to reupload my audio recording code because I realized I had incorrect variable types in a few spots. Give me a few minutes while I rectify this.
Title: Re: Maximize a minimized program anytime using WinAPI
Post by: SpriggsySpriggs on December 14, 2020, 09:30:19 am
OK, all good. Variable types for that are fixed. Didn't check the webcam code but I think that came after I started really understanding the WinAPI and so (I hope) it should have the correct variable types/sizes. It didn't. Fixed that, too (I think). It still worked when I tested it after changing the variable types and TYPE sizes. It still requires going over it with a fine-tooth comb. Maybe Petr wants to take a whack at it.
Title: Re: Maximize a minimized program anytime using WinAPI
Post by: Dav on December 14, 2020, 09:36:49 am
Got it! There's a lot more in there than I remembered. Thanks, @SpriggsySpriggs.
- Dav
Title: Re: Maximize a minimized program anytime using WinAPI
Post by: Petr on December 14, 2020, 10:59:17 am
Thanks @SpriggsySpriggs. I will look at it. It will take some time. :)