Pages: 1 2 3 4 5 6 7 8 9 10 11
Author Topic: Window Styler, Web Browser, and Embed Program  (890,803 Views)
Offline (Unknown gender) Goombert

Developer
Joined: Jan 2013
Posts: 2,991
View profile
Reply #90 Posted on: September 28, 2014, 10:23:38 PM
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
Offline (Unknown gender) time-killer-games
Guest


Email
Reply #91 Posted on: September 28, 2014, 10:49:41 PM
So how do I do that?

SetWindowLong(apphwnd, GWL_WNDPROC, ?);
Offline (Unknown gender) lonewolff
Guest


Email
Reply #92 Posted on: September 28, 2014, 10:52:11 PM
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
Offline (Unknown gender) time-killer-games
Guest


Email
Reply #93 Posted on: September 28, 2014, 10:55:14 PM
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.
Offline (Unknown gender) lonewolff
Guest


Email
Reply #94 Posted on: September 28, 2014, 11:01:06 PM
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. :)
Offline (Unknown gender) Goombert

Developer
Joined: Jan 2013
Posts: 2,991
View profile
Reply #95 Posted on: September 28, 2014, 11:05:24 PM
Quote from: TKGSo 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)
Offline (Unknown gender) lonewolff
Guest


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


Email
Reply #97 Posted on: September 28, 2014, 11:10:11 PM
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
Offline (Unknown gender) lonewolff
Guest


Email
Reply #98 Posted on: September 28, 2014, 11:12:06 PM
Quote from: time-killer-games on September 28, 2014, 11:10:11 PMI'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 :))
Offline (Unknown gender) Goombert

Developer
Joined: Jan 2013
Posts: 2,991
View profile
Reply #99 Posted on: September 28, 2014, 11:21:02 PM
Quote from: TKGThank 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.
Offline (Unknown gender) time-killer-games
Guest


Email
Reply #100 Posted on: September 28, 2014, 11:30:31 PM
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
Offline (Unknown gender) Darkstar2

Member
Joined: Jan 2014
Posts: 1,238
View profile
Reply #101 Posted on: September 28, 2014, 11:41:49 PM
Quote from: lonewolff on September 28, 2014, 10:52:11 PM
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.

Quote from: time-killer-games on September 28, 2014, 10:55:14 PM
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

Quote from: time-killer-games on September 28, 2014, 10:55:14 PM
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

Offline (Unknown gender) lonewolff
Guest


Email
Reply #102 Posted on: September 29, 2014, 12:02:55 AM
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.
Offline (Unknown gender) Goombert

Developer
Joined: Jan 2013
Posts: 2,991
View profile
Reply #103 Posted on: September 29, 2014, 12:07:36 AM
Quote from: Darkstar2YYG 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.
Offline (Unknown gender) time-killer-games
Guest


Email
Reply #104 Posted on: September 29, 2014, 12:29:43 AM
Quote from: lonewolff on September 28, 2014, 11:06:45 PM
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:

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
Pages: 1 2 3 4 5 6 7 8 9 10 11