For everything that's not in any way related to PureBasic. General chat etc...
SoulReaper
Enthusiast
Posts: 372 Joined: Sun Apr 03, 2005 2:14 am
Location: England
Post
by SoulReaper » Fri Sep 01, 2006 6:44 pm
While I was looking around on the net I found a very good link on code project
wish Pure Basics was more like this one...
http://www.codeproject.com/dialog/xmessagebox.asp
Hope thats of Interest
on a side note i am messing around with a little custom message box and i have a problem with it.
it appears on the taskbar when i dont want it to and i cant see a way around it, any help please...
Code: Select all
Procedure MessageBox(hwnd , Caption$, Text$, dwStyle, lpszIcon)
#MB_USERICON = $80
Protected my_messagebox.MSGBOXPARAMS
If hwnd<>0
hwnd=WindowID(hwnd)
EndIf
my_messagebox\cbSize=SizeOf(MSGBOXPARAMS)
my_messagebox\hwndOwner=hwnd ; change to windowID(#your window) if needed
my_messagebox\hInstance=0
my_messagebox\lpszText=@Text$
my_messagebox\lpszCaption=@Caption$
; lookup other dwStyles under SDK MessageBoxEx Function <<<---
my_messagebox\dwStyle=dwStyle
;{ more lpszIcon options
;IDI_APPLICATION
;IDI_ASTERISK
;IDI_ERROR
;IDI_EXCLAMATION
;IDI_HAND
;IDI_INFORMATION
;IDI_QUESTION
;IDI_WARNING
;IDI_WINLOGO
;}
my_messagebox\lpszIcon=lpszIcon
ProcedureReturn MessageBoxIndirect_(@my_messagebox)
EndProcedure
;PBMessageBoxQuit()
Result.b=MessageBox(0, "Exit Program","Exit Program Are You Sure ? "+Chr(13), #MB_YESNO | #MB_USERICON | #MB_DEFBUTTON2, #IDI_EXCLAMATION)
If Result.b=#IDYES ; Yes or #IDNO for no...
Beep_(100,50)
EndIf
End
Thankyou in Advance
Regards
Kevin
Trond
Always Here
Posts: 7446 Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway
Post
by Trond » Fri Sep 01, 2006 6:52 pm
What's the difference?
Code: Select all
MessageRequester("APPNAME", "Are you sure you want to exit the program?", #PB_MessageRequester_YesNo | #MB_DEFBUTTON2 | #MB_ICONWARNING)
SoulReaper
Enthusiast
Posts: 372 Joined: Sun Apr 03, 2005 2:14 am
Location: England
Post
by SoulReaper » Fri Sep 01, 2006 7:48 pm
Sorry forgot to say this way there is no warning bell
Trond
Always Here
Posts: 7446 Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway
Post
by Trond » Fri Sep 01, 2006 8:50 pm
I've got that muted anyways...
Code: Select all
Result.l = MessageRequester("APPNAME", "Are you sure you want to exit the program?", #PB_MessageRequester_YesNo | #MB_DEFBUTTON2 | #MB_ICONWARNING)
If Result = #IDYES ; Yes or #IDNO for no...
Beep_(100,50)
EndIf
SoulReaper
Enthusiast
Posts: 372 Joined: Sun Apr 03, 2005 2:14 am
Location: England
Post
by SoulReaper » Fri Sep 01, 2006 8:54 pm
@Trond Sorryz
I did not think it could be done that easy thankyou
p.s.
What did you think of that link to Code Project...
Regards
Kevin
Trond
Always Here
Posts: 7446 Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway
Post
by Trond » Fri Sep 01, 2006 9:23 pm
SoulReaper wrote:
What did you think of that link to Code Project...
The only interresting thing was the "do not show me again" checkbox. That would have been handy to have natively in PB.
PB
PureBasic Expert
Posts: 7581 Joined: Fri Apr 25, 2003 5:24 pm
Post
by PB » Sat Sep 02, 2006 12:10 am
> I've got that muted anyways
Your example doesn't mute the MessageRequester here.
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
thefool
Always Here
Posts: 5875 Joined: Sat Aug 30, 2003 5:58 pm
Location: Denmark
Post
by thefool » Sat Sep 02, 2006 12:34 am
Code: Select all
Result.l = MessageRequester("APPNAME", "Are you sure you want to exit the program?", #PB_MessageRequester_YesNo | #MB_DEFBUTTON2 | #MB_ICONWARNING|$80)
that works. just add $80 as a flag..
SoulReaper
Enthusiast
Posts: 372 Joined: Sun Apr 03, 2005 2:14 am
Location: England
Post
by SoulReaper » Sat Sep 02, 2006 12:36 am
@TheFool
Thankyou for the Tip your a star
@Srod
Yes you are right no Icon here on win2000 sp4 here as well
Darn...
Regards
Kevin
Last edited by
SoulReaper on Sat Sep 02, 2006 12:46 am, edited 2 times in total.
srod
PureBasic Expert
Posts: 10589 Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...
Post
by srod » Sat Sep 02, 2006 12:37 am
The inclusion of the $80 to the flags removes the icon here!
I may look like a mule, but I'm not a complete ass.
Trond
Always Here
Posts: 7446 Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway
Post
by Trond » Sat Sep 02, 2006 10:02 am
PB wrote: > I've got that muted anyways
Your example doesn't mute the MessageRequester here.
That was not about the MessageRequester, it was about the Beep_().
Edit: Well, he probably meant the MessageRequester. Anyways, I think that the programmer should respect the user's settings. If he has turned off the sound for that event in the control panel, no sound should play, and if he has specified a sound for that event, that sound should play.
thefool
Always Here
Posts: 5875 Joined: Sat Aug 30, 2003 5:58 pm
Location: Denmark
Post
by thefool » Sat Sep 02, 2006 10:34 am
srod wrote: The inclusion of the $80 to the flags removes the icon here!
damn
SoulReaper
Enthusiast
Posts: 372 Joined: Sun Apr 03, 2005 2:14 am
Location: England
Post
by SoulReaper » Sat Sep 02, 2006 1:02 pm
Thankyou to everyone for taking the time to talk on this post
I Guess I will leave the sound on as Trond said "its up to the User"
Regards
Kevin