Page 2 of 6
					
				
				Posted: Thu May 11, 2006 4:09 pm
				by thefool
				Inf0Byt3 wrote:Thanks. 
Remember we wanted to build something like this some time ago? Let's improve this one, add new gadgets, etc. What do you say?
I don't care how just get it done so i can use it!  

 
			 
			
					
				
				Posted: Thu May 11, 2006 4:13 pm
				by Inf0Byt3
				
 WIP.
 
			 
			
					
				
				Posted: Thu May 11, 2006 4:13 pm
				by thefool
				
			 
			
					
				
				Posted: Thu May 11, 2006 5:52 pm
				by josku_x
				@InfoByte: I can see what I do, in my first snippets, I hacked up the window buttons (their size, position, etc.).. So, if you want to make your engine better, don't make your own custom OpenWindow() function, you should create a function like: "EnableInfoSkin(hWnd)" that way more and more people would use the product and even buy if you make it commercial, but I see you want to keep it for free, so it's up to you what you will make.
Also, we code in whole different ways, your code looks easy-to-understand and optimized, but mine looks dirty and really(x10)-hard-to-understand. So, we can't work together, as good + evil = chaos.. (And I'm the evil 

 )
 
			 
			
					
				
				Posted: Thu May 11, 2006 6:00 pm
				by Inf0Byt3
				Also, we code in whole different ways
Agree. But your code is better 
your code looks easy-to-understand and optimized, but mine looks dirty
Come on.. Be serious. You code like a real programmer. All I do is simplify things until the program does not work anymore 

 .
About the EnableInfoSkin(hWnd) - style, how to achieve this? Create something like a hook for the window? That's too hard for me, I guess.
A question: How can I create an owner draw progressbar? I have 2 pictures, the border for the pr-bar and the State image? Any ideas?
 
			 
			
					
				
				Posted: Thu May 11, 2006 6:19 pm
				by josku_x
				Well, sure I'm a professional programmer, as I was a former VB user so I am very (and very means VERY) experienced in API programming.
About the owner drawn progressbar, well you could use something similar to this:
Code: Select all
StartDrawing(WindowOutput())
 LoadImage(#ProgressBar_Background, "MyImage.gif")
 LoadImage(#ProgressBar_State, "MyImage_2.gif")
 DrawImage(ImageID(#ProgressBar_Background), UserX, UserY)
 For i=1 To UserState
  DrawImage(ImageID(#ProgressBar_State), UserX+i, UserY+1)
 Next
StopDrawing()
It propably doesn't work as I typed from my mind... I am now at a friend..
EDIT: Forgot to tell about the EnableInfoSkin(hWnd) procedure. Well, that procedure internally sets the windowcallback of the specified hWnd to InfoSkinCallback(hWnd, Msg, wParam, lParam)
You enumerate all child windows of the hWnd window and get each child window's classname. After that you check the classname if it's valid (Button, ComboBox32, etc..), then you REAL skin the gadget.
It isn't hard to make, but requires a high knowledge of the Win API. So if I were you, I wouldn't start with such a big project, but I know this means a lot to you. And real skinning the gadget isn't hard, but requires more than 1 or 2 routines (structures/interfaces).
I hope you know now how to make things. But I am busy now, so I can't help you much.
 
			 
			
					
				
				Posted: Thu May 11, 2006 6:36 pm
				by Inf0Byt3
				Got it. Thank you. One more thing I don't know. What do you mean by REAL skinning of the button? If you can, when you are free, can you show me a small example of how to subclass a single normal gadget to change the way it looks? If I have an example, it's easy to implement the rest, I just need a quickstart. I simply cannot find a logical explanation of how to change the content of a control with a bitmap.
			 
			
					
				
				Posted: Thu May 11, 2006 7:02 pm
				by josku_x
				Ok, I'll try to help you-
			 
			
					
				
				Posted: Thu May 11, 2006 7:23 pm
				by Inf0Byt3
				Great! Thanks.
			 
			
					
				
				Posted: Sun May 14, 2006 4:48 pm
				by Inf0Byt3
				Update2 . Added progressbar infogadget 

. Check the main post for the changelog and download link.
 
			 
			
					
				
				Posted: Sun May 14, 2006 5:38 pm
				by Poshu
				Look good. If you can add a few more gadget, it will even look great ^_^.
			 
			
					
				
				Posted: Sun May 14, 2006 5:49 pm
				by Inf0Byt3
				Thanks! I will add some more gadgets soon. I am thinking to improve it a little bit and add some compression routines inside.
[Update]
Check the main post.
			 
			
					
				
				Posted: Mon May 15, 2006 6:59 pm
				by Poshu
				lovely ^^;
			 
			
					
				
				Posted: Tue May 16, 2006 12:21 am
				by dagcrack
				Never use getasynckeystate_(#VK_LBUTTON) 
Instead, you must catch the messages #WM_LBUTTONDOWN and #WM_LBUTTONUP !.
You CAN catch those without using a callback, but you should use one already for secure messaging.
And if you really want to use GetAsyncKeyState(); Then you'll need to do a test to see if your window has focus first, because it will fire/trigger whenever you click your LMB anywhere at your system.
This is an overhead of 2 api calls vs catching a message.  It's your call though, I'd go with the callback for some comfy messaging. But you could always call GetKeyState()...
			 
			
					
				
				Posted: Tue May 16, 2006 12:11 pm
				by Inf0Byt3
				Thanks for the tip 

. I'm adding it as soon as i can.