Anti Minimize Window

Share your advanced PureBasic knowledge/code with the community.
cas
Enthusiast
Enthusiast
Posts: 597
Joined: Mon Nov 03, 2008 9:56 pm

Post by cas »

@RASHAD
You don't understand what i'm trying to say.
If PB compiler is breaking some rules when creating exe, it is not important because end user won't notice this (it will be same for user if exe is compiled in PB or Visual Studio because exe will run as expected and will not harm system) but it will be irritating if user use "Show Desktop" and then he don't see it.
RASHAD
PureBasic Expert
PureBasic Expert
Posts: 4954
Joined: Sun Apr 12, 2009 6:27 am

Post by RASHAD »

@cas
Everything looks normal to me
ShowDesktop Works as usual

And please cas the forum lately has enough 2 misunderstanding
I am not going to be the third flame

have a good day
cas
Enthusiast
Enthusiast
Posts: 597
Joined: Mon Nov 03, 2008 9:56 pm

Post by cas »

RASHAD wrote:@cas
Everything looks normal to me
ShowDesktop Works as usual

And please cas the forum lately has enough 2 misunderstanding
I am not going to be the third flame

have a good day
You still don't understand, of course "Show Desktop" works normal, as usual.
But with this code it will be broken in some way.
rsts
Addict
Addict
Posts: 2736
Joined: Wed Aug 24, 2005 8:39 am
Location: Southwest OH - USA

Post by rsts »

cas - I understand.

But it's a TIP, not necessarily a recommendation or even suggestion.

If I include it in a program, maybe people won't use my program, but that is UP TO ME, not the forum police.

cheers
cas
Enthusiast
Enthusiast
Posts: 597
Joined: Mon Nov 03, 2008 9:56 pm

Post by cas »

rsts wrote:cas - I understand.
I know that you understand, but RASHAD don't.
rsts wrote:But it's a TIP, not necessarily a recommendation or even suggestion.
I said that before, and i appreciate it as tip.

Your whole post sounds to me like i have done something terrible when posting in this topic... but i only wanted to help.
rsts
Addict
Addict
Posts: 2736
Joined: Wed Aug 24, 2005 8:39 am
Location: Southwest OH - USA

Post by rsts »

cas.

You are very helpful and a great contributor. I appreciate the help you offer in the forums.

My concern was that Rashad would feel attacked for making the post and thus be reluctant to post further tips. As long as his tips aren't promoting malware, (which would kind of be the opposite of this tip), I want to encourage further posting.

By BOTH of you.

cheers
RASHAD
PureBasic Expert
PureBasic Expert
Posts: 4954
Joined: Sun Apr 12, 2009 6:27 am

Post by RASHAD »

@rsts
I posted @ 38 posts let us say 15 are acting
In each post from 2 to 5 new tips
5 of them are majors 15 are minors
Which let me feel that I did what is enough for the next 2 years
Go back to my posts
Boys you do not read between lines
cas are attacking me alright but it does not matter
I will slow down

bye
cas
Enthusiast
Enthusiast
Posts: 597
Joined: Mon Nov 03, 2008 9:56 pm

Post by cas »

RASHAD wrote:cas are attacking me alright but it does not matter
I'm not attacking you. Just discussing on topic subject. Please don't be offended, that were not my intentions. I'm grateful for your code snippet.


I'm not native english speaker so i probably made some grammatical mistakes and because of that i was not clear.
RASHAD
PureBasic Expert
PureBasic Expert
Posts: 4954
Joined: Sun Apr 12, 2009 6:27 am

Post by RASHAD »

@cas
When I post "Anchor the first column in ListIconGadget" that was my second
post in my whole life and you was there to help
so I was preparing myself to do Load and Run DLL from memory for
you ,myself and the others
Right now I am so depressed
It will take time to heel
After all I am Str.Engineer not a Programmer
Beside you are now a Corporal I am still a Private
I salute you
cas
Enthusiast
Enthusiast
Posts: 597
Joined: Mon Nov 03, 2008 9:56 pm

Post by cas »

RASHAD wrote:Right now I am so depressed
It will take time to heel
Please don't be. This is all one big misunderstanding.
I want to help, too, like you do.
Sparkie
PureBatMan Forever
PureBatMan Forever
Posts: 2307
Joined: Tue Feb 10, 2004 3:07 am
Location: Ohio, USA

Post by Sparkie »

RASHAD wrote:I am waiting for sparki or srod to come with a good solution by intercepting the taskbar call
Tested on XP...

Code: Select all

Procedure WinCallback(hwnd, msg, wParam, lParam) 
  result = #PB_ProcessPureBasicEvents 
  Select msg 
    Case #WM_NCDESTROY 
      RemoveProp_(hwnd, "minimize") 
      ;... Allow Minimizing from Window Caption 
    Case #WM_SYSCOMMAND 
      If wParam = #SC_MINIMIZE 
        SetProp_(hwnd, "minimize", 1) 
      EndIf 
    Case #WM_SIZE 
      min = GetProp_(hwnd, "minimize") 
      ;... Prevnt minimizing with show desktop 
      If wParam = #SIZE_MINIMIZED And min = 0 
        ShowWindow_(hwnd, #SW_RESTORE) 
        SetWindowPos_(hwnd, #HWND_TOPMOST, 0, 0, 0, 0, #SWP_NOSIZE | #SWP_SHOWWINDOW) 
      EndIf 
      SetProp_(hwnd, "minimize", 0) 
  EndSelect 
  ProcedureReturn result 
EndProcedure 
OpenWindow(0, 0, 0, 320, 240, "", #PB_Window_SystemMenu | #PB_Window_MaximizeGadget | #PB_Window_MinimizeGadget) 
SetProp_(WindowID(0), "minimize", 0) 
SetWindowCallback(@WinCallback()) 
Repeat 
  event = WaitWindowEvent() 
Until event = #PB_Event_CloseWindow 
Last edited by Sparkie on Thu Jul 23, 2009 12:43 am, edited 1 time in total.
What goes around comes around.

PB 5.21 LTS (x86) - Windows 8.1
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8451
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Post by netmaestro »

Sparkie, testing on Win7 RC your code is preventing all open windows from minimizing in response to 'Show Desktop'. Is it intended?
BERESHEIT
rsts
Addict
Addict
Posts: 2736
Joined: Wed Aug 24, 2005 8:39 am
Location: Southwest OH - USA

Post by rsts »

Hmm - on mine everything minimizes as normal - including sparkie's window :(

cheers

win 7 RTM
RASHAD
PureBasic Expert
PureBasic Expert
Posts: 4954
Joined: Sun Apr 12, 2009 6:27 am

Post by RASHAD »

@Sparkie
Welcome back
That is all what I was aiming to
Welcome back again man ,when you are around I feel much better

@Netmaestro
I am very glad to talk to my friend yes very glad


Thank you very much
I really do not care much about the tip it is not my business it is yours

Thank you boys and have a good year and it is not enough for you both

RASHAD
Sparkie
PureBatMan Forever
PureBatMan Forever
Posts: 2307
Joined: Tue Feb 10, 2004 3:07 am
Location: Ohio, USA

Post by Sparkie »

@netmaestro: No sir, that is not the intention. No Win7 here so you're on your own my friend. :(

@rsts: Go up and help netmaestro figure this one out would ya. :wink:

@RASHAD: Thank you for the kind words. :)
What goes around comes around.

PB 5.21 LTS (x86) - Windows 8.1
Post Reply