Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / Need help with comdlg32.dll file brower function. Mouse not showing up!

Author
Message
Caleb1994
17
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 6th Jan 2009 04:15
I downloaded this from another forum post and the mouse won't show up :/ aaahhhh lol. i tried showing the mouse and it still won't. before the file browser comes up it works but when it comes up the mouse dissaperes and the background goes white. although you can still click on stuff its like it's hidden but it's not
Latch
19
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 6th Jan 2009 04:33
In order to get most win32 dialog boxes to work with DBC, your program has to run in windowed mode. If you must use fullscreen mode, you can still navigate using the TAB key and the cursor keys and enter.

Enjoy your day.
Caleb1994
17
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 6th Jan 2009 05:29 Edited at: 6th Jan 2009 05:37
thanks latch it works now but the way this function is set up it uses memblocks (i'm geussing thats the only way) but if i try to put the filter blank it says the memblock cant equal 0 and when i try to put a filter in it doesn't filter write. i'v tried doing ".bmp" "*.bmp" "bmp" but nuthing works it doesn't show anything exept files heres the code any help?




[Edit]

Heck yes i just fixed it! i took out make memblock FileFilter_MB,len(FileFilter$) and FileFilter = get memblock ptr(FileFilter_MB) and then took out the part where it deletes em and it works great now! yay now i can use window mode for my paint program(i was using TDK's file selector functions and alert boxes. hey do you happen to have any functions using windows dll's that do alert boxes. i found on msdn where to find the calls but everyone always uses functions they make with memblocks and stuff and i'm not good with that haha or do you know where to find it
Latch
19
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 6th Jan 2009 18:01 Edited at: 6th Jan 2009 18:13
Though I didn't look over the above code in great detail a line stood out:



These are flags that tell the open dialog box how to behave. Usually if there are going to be multiple flags set for a win32 api function parameter, they are not ADDED together. Instead they are ORed together. Sometimes, two flags may have different names but their values may contain the same bits being set. For example, let's pretend there is a flag name called DEFAULT and another called OK_BUTTON. DEFAULT could equal 1 and OK_BUTTON can equal 3. If you add these, the flag value = 1+3 = 4 . If you OR these then 1 | 3 = 3 . If the value becomes 4 then flag becomes something completely different. When flag is 3 (1 | 3) , it represents both flags.

In short, the '+' should be replaced with '|' using multiple flags. Though I can see all of these flags are powers of 2 so they won't interfere with each other if added; but they should be ORed '|' .


Quote: "now i can use window mode for my paint program"

If you want to use the windows color select dialog box also check out:

Color Select

Though I wrote that when I wasn't as familiar with DBC as I am now, I think it still works. You can eliminate the full paths to the dlls c:windowssystemetc... and just load the dlls by the name: load dll "user32.dll",number

Quote: "hey do you happen to have any functions using windows dll's that do alert boxes. i found on msdn where to find the calls but everyone always uses functions they make with memblocks and stuff and i'm not good with that haha or do you know where to find it "


Here is the basic call for a message box:



hwnd is an identifyer of the window that the message box belongs to. In this case, I call it as the active window which should be the DBC app window you are working in.

In this example, the last digits '1|48', in the DLL call is the parameter for the flags that tell the message box how to behave.

That can be replaced with combinations of the flags to follow. This first group are some basic types of message box that includes the sound produced and the icon inside. The sounds are based on the users preference settings:
MB_ICONASTERISK = 64
MB_ICONEXCLAMATION = 48
MB_ICONWARNING = 48
MB_ICONERROR = 16
MB_ICONHAND = 16
MB_ICONQUESTION = 32

The next group is the number and types of buttons:
MB_OK = 0
MB_OKCANCEL = 1
MB_ABORTRETRYIGNORE = 2
MB_YESNO = 4
MB_YESNOCANCEL = 3

Usage would be like:


Depending on the button pressed, result will have a value. Branch to the appropriate code in your app based on result's value.

Using the dialog boxes can wipe out the background behind them in a DBC app. Though it may be a bit advanced, check out the following link:

Dialog Boxes erasing background

Enjoy your day.
Caleb1994
17
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 6th Jan 2009 19:02
Thanks latch! that helps tons but one question so in that other post the idea that was settled on was texture the backdrop with a image of the screen?

Oh and thanks for the message box stuff helps tons Thanks!
Latch
19
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 6th Jan 2009 21:43
Quote: "Thanks latch! that helps tons but one question so in that other post the idea that was settled on was texture the backdrop with a image of the screen?"


That's the idea, but the method is a little more complicated. There aren't any DBC commands that will do this (besides call dll). It has to be done with win32 api calls and a changing of the class attribute that controls a window background image or color. It is this true window background that is changed with a screen shot of the screen. The background you see in DBC is the render area where DirectX draws stuff. Behind that is the window background and it is black by default. This is the background that shows through when you drag a dialog box or message box around a DBC window.

Enjoy your day.
Caleb1994
17
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 7th Jan 2009 05:14
oh thats interesting i did not know that when you change the background color that it didn't really change it but i see what you mean about the direct X stuff. at this point i'm going to just mess around with windows api and stuff before i actually try implementing any into my paint or anything for that matter. by the way do you know if TDK has a new site (his current one is down has been since i joined i think) and I have a old version of the file select thing and the new alert functions can do more so just wondering?
Latch
19
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 8th Jan 2009 04:34 Edited at: 8th Jan 2009 04:37
Quote: "by the way do you know if TDK has a new site (his current one is down has been since i joined i think) and I have a old version of the file select thing and the new alert functions can do more so just wondering? "

Don't know... TDK's gui tools are top notch!

If you want a complete windows like system built in DBC, you should also check out MagicWindows by Freddix:

MagicWindows

Main Webpage

Enjoy your day.
Caleb1994
17
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 9th Jan 2009 21:43 Edited at: 9th Jan 2009 22:01
yes tdk's stuff is amazing! i love it but the downside is i cant use windowed mode idk why

edit:

ok i checked out magic windws. its ok. the main problem was the text size. you might b able tob change ut but its all in french. but it was to big for the menus
Latch
19
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 10th Jan 2009 04:15
Oh yeah... It's written in an older DB so that means the set text font commands don't have a ,character set after them so in DB 1.20 the size won't set correctly. If you had the inclination and a lot of time on your hands, you could go through all of the code and change those! You know, I think I may have done that already... let me check my archives...

[a few minutes later...]

Yup. I think at some point I went through the code and fixed that. It seems to be working. Here's a screeny:

And let me know if you want what I believe to be the corrected text version.

Enjoy your day.
Caleb1994
17
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 10th Jan 2009 16:12
yes that was the correct fix that would be awesome if you could upload it thanks


the weird thing is on the site it looks normal but when you downloAD IT it has the huge text
Latch
19
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 10th Jan 2009 20:11
I ran through the examples again to make sure. Seems ok. If you run into problems, just search through the functions for SET TEXT FONT and make sure there is a ,1 any time that command is called. Anyway, here's the MagicWindows (upgraded for DBC 1.20 I think)

Enjoy your day.
Caleb1994
17
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 10th Jan 2009 21:55
thanks latch you have helped tons i dont think i'll use thiss formy paint progam but it cud b usefull l8r

Login to post a reply

Server time is: 2026-07-05 01:48:02
Your offset time is: 2026-07-05 01:48:02