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 Professional Discussion / [set window on] workaround for DBP

Author
Message
mr Handy
18
Years of Service
User Offline
Joined: 7th Sep 2007
Location: out of TGC
Posted: 26th Jan 2013 14:20 Edited at: 26th Jan 2013 15:17
Hi guys, some of you (including Lee Bamber I suppose) know that there is a kinda bug with set window on command.
Window mode from project properties works as it should.
But that code does not:

It sets the size of the WHOLE window including title bar, so your working area is stretched.

Here is the workaround:


Please test it, I hope it works flawlessly.

EDIT: Also I wanted to make workaround for set window layout, to disable resize border AND min/max buttons, but "SetWindowLong" (and similar to it, like "GetWindowLong") doesn't work with DBP

*** Merry Chuckmas! ***
mr Handy
18
Years of Service
User Offline
Joined: 7th Sep 2007
Location: out of TGC
Posted: 4th Feb 2013 07:25
So nobody tested/used it yet?

*** Merry Chuckmas! ***
mr Handy
18
Years of Service
User Offline
Joined: 7th Sep 2007
Location: out of TGC
Posted: 7th Feb 2013 07:07


*** Merry Chuckmas! ***
BMacZero
20
Years of Service
User Offline
Joined: 30th Dec 2005
Location: E:/ NA / USA
Posted: 7th Feb 2013 10:00
Works great here, this should actually be a really handy bit of code.

mr Handy
18
Years of Service
User Offline
Joined: 7th Sep 2007
Location: out of TGC
Posted: 7th Feb 2013 12:18 Edited at: 7th Feb 2013 12:20
It would be awesome to get SetWindowLong work with DBP, but I not succeeded in this. DB just says that there is no such function.

*** Merry Chuckmas! ***
Booma
17
Years of Service
User Offline
Joined: 29th Mar 2009
Location:
Posted: 8th Feb 2013 20:58 Edited at: 8th Feb 2013 21:09
@mr Handy



you can use SetWindowLongW for Unicode or SetWindowLongA as default function also don't forget about SetWindowPos
mr Handy
18
Years of Service
User Offline
Joined: 7th Sep 2007
Location: out of TGC
Posted: 9th Feb 2013 04:13
@Booma
Quote: "HWND=Call Dll(1,"FindWindowA","Dark Basic Pro Project12345","Dark Basic Pro Project") `put your project name here"

What is a "Dark Basic Pro Project12345"? I put 0 here.

Also is my code correct?

*** Merry Chuckmas! ***
Booma
17
Years of Service
User Offline
Joined: 29th Mar 2009
Location:
Posted: 11th Feb 2013 12:04
@mr Handy

Quote: "
What is a "Dark Basic Pro Project12345"?
"


This is window class name.

syntax
WindowHandle=FindWindow(ClassName,WindowName)


I use Microsoft Spy++ for viewing all classes in application. And yes instead of a class name it is possible to use 0. Your code is correct.
mr Handy
18
Years of Service
User Offline
Joined: 7th Sep 2007
Location: out of TGC
Posted: 11th Feb 2013 19:27 Edited at: 11th Feb 2013 19:30
Thank you, Booma! I had doubts because there were many commands to get border data...

*** Merry Chuckmas! ***

Login to post a reply

Server time is: 2026-07-07 12:50:40
Your offset time is: 2026-07-07 12:50:40