Pages: « 1 2 3 4 5 6 7 8 9 10 11 »
  Print  
Author Topic: Window Styler, Web Browser, and Embed Program  (Read 99152 times)
Offline (Male) Goombert
Reply #90 Posted on: September 28, 2014, 05:23:38 pm

Developer
Location: Cappuccino, CA
Joined: Jan 2013
Posts: 2993

View Profile
TKG, ok, do you have the handle to the control? What you would want to do is intercept all of its window messages, but I don't think that can be done without directly controlling it and delegating the messages.

It goes like this, in order to get WM_SIZE or WM_PAINT or other messages from the window, we hand it a process to its class/container which is used to create the window.
https://github.com/enigma-dev/enigma-dev/blob/master/ENIGMAsystem/SHELL/Platforms/Win32/WINDOWSmain.cpp#L224
We then process the messages.
https://github.com/enigma-dev/enigma-dev/blob/master/ENIGMAsystem/SHELL/Platforms/Win32/WINDOWScallback.cpp#L72
And if we want we can optionally pass messages right back to Win32 for Windows to handle the message itself.
https://github.com/enigma-dev/enigma-dev/blob/master/ENIGMAsystem/SHELL/Platforms/Win32/WINDOWScallback.cpp#L247

So what I am wondering if there is a way to take the handle of your control and attach it a message process after it has already been created. These are formally called Window Procedures.
http://msdn.microsoft.com/en-us/library/windows/desktop/ms632593%28v=vs.85%29.aspx

Found it
Use SetWindowLong with GWL_WNDPROC and you can change the window procedure to your own function and intercept all messages from the child control.
http://msdn.microsoft.com/en-us/library/windows/desktop/ms633591%28v=vs.85%29.aspx
Logged
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.

Offline (Unknown gender) time-killer-games
Reply #91 Posted on: September 28, 2014, 05:49:41 pm
"Guest"


Email
So how do I do that?
Code: [Select]
SetWindowLong(apphwnd, GWL_WNDPROC, ?);
Logged
Offline (Unknown gender) lonewolff
Reply #92 Posted on: September 28, 2014, 05:52:11 pm
"Guest"


Email
5 Star'd ya!

Please send your money order to Rob now ;)

I fixed your first extension, Rob fixed your second. Do we try the third and fourth ones now :P
« Last Edit: September 28, 2014, 05:55:02 pm by lonewolff » Logged
Offline (Unknown gender) time-killer-games
Reply #93 Posted on: September 28, 2014, 05:55:14 pm
"Guest"


Email
First I'll need to ask daddy for money because I'm unemployed, and never had a job :P (which makes me a loser due to my age)

Thanks Lonewolff!!!! This wouldn't be possible with you and darkstar2! and Robert!

And did it really work? I'm still surprised darkstar because that was literally pure luck I have no idea how I got it working but I guess it is.
« Last Edit: September 28, 2014, 05:56:51 pm by time-killer-games » Logged
Offline (Unknown gender) lonewolff
Reply #94 Posted on: September 28, 2014, 06:01:06 pm
"Guest"


Email
Yep, haven't tested thoroughly yet. But looking good  (Y)

So, I have no idea what is different on your system to that of everyone else.  ???

Probably some wierd dependency somewhere and possibly pure luck that it worked for you in the first place.

If it turns out it is stable (checking now), I'd certianly up the price to $9.99 if I were in your shoes. Up to you though. :)

P.S. do you have the ability to delete your follow up comments on the ratings? I'd do that if I were you also. It'll look better for you as a seller. People will assume that these have always been stable from the start then. :)
« Last Edit: September 28, 2014, 06:06:35 pm by lonewolff » Logged
Offline (Male) Goombert
Reply #95 Posted on: September 28, 2014, 06:05:24 pm

Developer
Location: Cappuccino, CA
Joined: Jan 2013
Posts: 2993

View Profile
Quote from: TKG
So how do I do that?

Like this...

Code: (cpp) [Select]
LRESULT CALLBACK DllChildWndProc (HWND hWndParameter, UINT message,WPARAM wParam, LPARAM lParam)
{
  switch (message) {
    case WM_CREATE:
      return 0;
  }
  return DefWindowProc(hWndParameter, message, wParam, lParam);
}

void somefunctionwhereyouwanttotakecontrolofthechildwindow() {
  SetWindowLong(childWindowhWnd, GWL_WNDPROC, DllChildWndProc);
}

Then you have complete control over all messages for the child control. (Y)
Logged
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.

Offline (Unknown gender) lonewolff
Reply #96 Posted on: September 28, 2014, 06:06:45 pm
"Guest"


Email
Tested some more - It is freakin awesome! (Which I figured it would be - as long as it worked  :D)
Logged
Offline (Unknown gender) time-killer-games
Reply #97 Posted on: September 28, 2014, 06:10:11 pm
"Guest"


Email
Thank you Bob! I'm on my hour break that my parents require me every 2 hours but when I'm back I'll add that. It's very useful! I've been wondering how to fix the window focus for more than a week now, so I'm very excited to get this done!

Thanks again Beowulf! ;D
Logged
Offline (Unknown gender) lonewolff
Reply #98 Posted on: September 28, 2014, 06:12:06 pm
"Guest"


Email
I'm on my hour break that my parents require me every 2 hours.

Dafaq? You coding from the asylum?

Things are starting to make sense now  :D

[edit]
Don't forget the two hourly medication too!  ;D (LOL - JK :))
Logged
Offline (Male) Goombert
Reply #99 Posted on: September 28, 2014, 06:21:02 pm

Developer
Location: Cappuccino, CA
Joined: Jan 2013
Posts: 2993

View Profile
Quote from: TKG
Thank you Bob!
No problem but the point is I was trying to show you that you do not have to switch from using BASIC to accomplish it. I just don't know the BASIC counter part off hand but as long as this BASIC language lets you do windows and loops and handles you should not have to switch languages.
Logged
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.

Offline (Unknown gender) time-killer-games
Reply #100 Posted on: September 28, 2014, 06:30:31 pm
"Guest"


Email
Yes the basic programming language of blitzmax created the browser control and window, but the rest (like embedding that window in the game) I'm doing in C++.  It's a lot of nails, spit, glue, and duct tape but it's getting there. :P
Logged
Offline (Unknown gender) Darkstar2
Reply #101 Posted on: September 28, 2014, 06:41:49 pm
Member
Joined: Jan 2014
Posts: 1238

View Profile Email
5 Star'd ya!

Please send your money order to Rob now ;)

I fixed your first extension, Rob fixed your second. Do we try the third and fourth ones now :P

Actually it is TKG himself who fixed it, Robert assisted with the window focusing thing, that was a separate problem, the main problem was the browser not displaying.  You see TKG ? Next time before releasing something on the market, get it tested by as many people as possible, as you can see many people willing to help, and rule of thumb, just because it works on your system does not mean it will on everyone's, especially when you are dealing with plugins/dependencies, etc. It's better to be safe and sure.

First I'll need to ask daddy for money because I'm unemployed, and never had a job :P (which makes me a loser due to my age)

YYG is hiring....You are in Scotland right ?  ;D

And did it really work? I'm still surprised darkstar because that was literally pure luck I have no idea how I got it working but I guess it is.

Too bad you don't remember what you changed that would have been helpful for future reference and learning experience.
But that won't always happen though, luckily this one story ends well :D

Logged
Offline (Unknown gender) lonewolff
Reply #102 Posted on: September 28, 2014, 07:02:55 pm
"Guest"


Email
TKG - how did you get the child window inside the GM:S window without GM:S painting over the top?

I have recently been trying to do something different with GM:S, but no way can I stop GM:S painting over my new child window.
Logged
Offline (Male) Goombert
Reply #103 Posted on: September 28, 2014, 07:07:36 pm

Developer
Location: Cappuccino, CA
Joined: Jan 2013
Posts: 2993

View Profile
Quote from: Darkstar2
YYG is hiring....You are in Scotland right ?
He's actually in Chinatown right now.

And this is what he looks like in Chinatown with no meds.
Logged
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.

Offline (Unknown gender) time-killer-games
Reply #104 Posted on: September 28, 2014, 07:29:43 pm
"Guest"


Email
TKG - how did you get the child window inside the GM:S window without GM:S painting over the top?

I have recently been trying to do something different with GM:S, but no way can I stop GM:S painting over my new child window.
If you want child controls (buttons, checkbox, listview, embedded windows, etc) you need to set the main game window to clip children, for example:

Code: [Select]
SetWindowLongPtr(window_handle(),GWL_STYLE,WS_VISIBLE|WS_SYSMENU|WS_BORDER|WS_CAPTION|WS_CLIPCHILDREN)WS_CLIPCHILDREN must be added to the window's styles every step otherwise the clip settings will return to default which disables clipping children.

Edit: Robert is at it again he thinks I live in china town because facebook showed him my posting location WITH THE WRONG LOCATION. :P lol
« Last Edit: September 28, 2014, 07:34:21 pm by time-killer-games » Logged
Pages: « 1 2 3 4 5 6 7 8 9 10 11 »
  Print