• Welcome to Valhalla Legends Archive.
 

Hrmm i need help

Started by Michael, November 01, 2003, 05:21 PM

Previous topic - Next topic

Grok

Quote from: Adron on November 02, 2003, 09:56 AM
Dividing it by twips *is* a common way to implement that though.

Dividing the current cursor X position by twipsperpixelX will reliably result in 0x201, telling you when the left mouse button is pressed?  I don't think so.  X varies, TPPX is a constant, and WM_LBUTTONDOWN is a constant.  And so far, none of that tells you the state of the mouse buttons.

-Michael-, check the value of Button (and value of Shift if you care).  These will tell you when to change WindowState to 0-vbNormal.  Get rid of that msg=x/TPPX stuff.

Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
   Select Case Button
   Case vbLeftButton       '1 Left button is pressed.
       Me.Show
       Me.SetFocus
       Me.WindowState = vbNormal
   Case vbRightButton      '2 Right button is pressed.
       PopupMenu mnuPopup
   Case vbMiddleButton     '4 Middle button is pressed.
   End Select
End Sub


Michael

#16
Quote from: Grok on November 02, 2003, 10:54 AM
Quote from: Adron on November 02, 2003, 09:56 AM
Dividing it by twips *is* a common way to implement that though.

Dividing the current cursor X position by twipsperpixelX will reliably result in 0x201, telling you when the left mouse button is pressed?  I don't think so.  X varies, TPPX is a constant, and WM_LBUTTONDOWN is a constant.  And so far, none of that tells you the state of the mouse buttons.

-Michael-, check the value of Button (and value of Shift if you care).  These will tell you when to change WindowState to 0-vbNormal.  Get rid of that msg=x/TPPX stuff.


Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
   Select Case Button
   Case vbLeftButton       '1 Left button is pressed.
       Me.Show
       Me.SetFocus
       Me.WindowState = vbNormal
   Case vbRightButton      '2 Right button is pressed.
       PopupMenu mnuPopup
   Case vbMiddleButton     '4 Middle button is pressed.
   End Select
End Sub



I tried the code,

Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
   Select Case Button
   Case vbLeftButton      '1 Left button is pressed.
       Me.Show
       Me.SetFocus
       Me.WindowState = vbNormal
   Case vbRightButton      '2 Right button is pressed.
       PopupMenu mnuPopup
   Case vbMiddleButton    '4 Middle button is pressed.
   End Select
End Sub

I cannot seem to understand why it is not coming back from the tray.

Well i also have something that may be the answer to it my friend suggested useing a .OCX system tray icon1.0.ocx, when i went to use it i found out my vb dosnt have it. Could that be the reason it does not work do i need the .ocx?

Crim-Training

did you install the ocx by any chance ?

regsvr32 in Run followed by path

Adron

Quote from: Grok on November 02, 2003, 10:54 AM
Quote from: Adron on November 02, 2003, 09:56 AM
Dividing it by twips *is* a common way to implement that though.

Dividing the current cursor X position by twipsperpixelX will reliably result in 0x201, telling you when the left mouse button is pressed?  I don't think so.  X varies, TPPX is a constant, and WM_LBUTTONDOWN is a constant.  And so far, none of that tells you the state of the mouse buttons.

Yes it does.

That is a trick I've seen used in more than one place to get around the fact that you cannot define your own windows message handlers in VB. What you do when you need a user defined message then, is that instead of passing in something like WM_USER+1, you tell windows to call you back with WM_MOUSEMOVE. You can then get to the loword of lParam by knowing that VB has multiplied it by twipsperpixelx and is passing it to you as "X".

Michael

Quote from: Crim-Training on November 02, 2003, 01:02 PM
did you install the ocx by any chance ?

regsvr32 in Run followed by path
He didnt send me the .ocx could u send me it crim?

Michael

Quote from: Adron on November 02, 2003, 03:03 PM
Quote from: Grok on November 02, 2003, 10:54 AM
Quote from: Adron on November 02, 2003, 09:56 AM
Dividing it by twips *is* a common way to implement that though.

Dividing the current cursor X position by twipsperpixelX will reliably result in 0x201, telling you when the left mouse button is pressed?  I don't think so.  X varies, TPPX is a constant, and WM_LBUTTONDOWN is a constant.  And so far, none of that tells you the state of the mouse buttons.

Yes it does.

That is a trick I've seen used in more than one place to get around the fact that you cannot define your own windows message handlers in VB. What you do when you need a user defined message then, is that instead of passing in something like WM_USER+1, you tell windows to call you back with WM_MOUSEMOVE. You can then get to the loword of lParam by knowing that VB has multiplied it by twipsperpixelx and is passing it to you as "X".

I don't mean to impose but, when crim sent me his source he used twipsperpixelX. same with shadow and stealth so i guess it works?

Michael

hrmm i think my comps having problems cuz when i signed in with my aol browser i was banned and then with ie and i am not banned i no its off topic but i was wondering if you could explain why.

iago

Quote from: -MichaeL- on November 02, 2003, 11:11 PM
hrmm i think my comps having problems cuz when i signed in with my aol browser i was banned and then with ie and i am not banned i no its off topic but i was wondering if you could explain why.

huh?
This'll make an interesting test for broken AV:
QuoteX5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*


Grok

OK, since I don't know this technique and Adron does, I'll bow out and let him answer this question.

Adron

#24
Quote from: Grok on November 03, 2003, 11:16 AM
OK, since I don't know this technique and Adron does, I'll bow out and let him answer this question.

I don't know it, I just recognize it and have copy-pasted it from an example once or twice. If I'd known what was wrong I'd have answerred already :)

edit: (my copy-paste of it worked fine btw)

Michael

Quote from: Adron on November 03, 2003, 12:54 PM
Quote from: Grok on November 03, 2003, 11:16 AM
OK, since I don't know this technique and Adron does, I'll bow out and let him answer this question.

I don't know it, I just recognize it and have copy-pasted it from an example once or twice. If I'd known what was wrong I'd have answerred already :)

edit: (my copy-paste of it worked fine btw)
Well im glad that yours worked but early today i found out crim has start having the same problems as me could it have something to do with a virus or a virus program or some other type of program?

Banana fanna fo fanna

Quote from: -MichaeL- on November 03, 2003, 01:58 PM
Quote from: Adron on November 03, 2003, 12:54 PM
Quote from: Grok on November 03, 2003, 11:16 AM
OK, since I don't know this technique and Adron does, I'll bow out and let him answer this question.

I don't know it, I just recognize it and have copy-pasted it from an example once or twice. If I'd known what was wrong I'd have answerred already :)

edit: (my copy-paste of it worked fine btw)
Well im glad that yours worked but early today i found out crim has start having the same problems as me could it have something to do with a virus or a virus program or some other type of program?

Periods?

Michael

Quote from: St0rm.iD on November 03, 2003, 02:13 PM
Quote from: -MichaeL- on November 03, 2003, 01:58 PM
Quote from: Adron on November 03, 2003, 12:54 PM
Quote from: Grok on November 03, 2003, 11:16 AM
OK, since I don't know this technique and Adron does, I'll bow out and let him answer this question.

I don't know it, I just recognize it and have copy-pasted it from an example once or twice. If I'd known what was wrong I'd have answerred already :)

edit: (my copy-paste of it worked fine btw)
Well im glad that yours worked but early today i found out crim has start having the same problems as me could it have something to do with a virus or a virus program or some other type of program?

Periods?
if you cant understand what i write then dont respond no one told u to be a jerk did they or maybe you have no manners?

MrRaza


Banana fanna fo fanna

Quote from: -MichaeL- on November 03, 2003, 04:19 PM
Quote from: St0rm.iD on November 03, 2003, 02:13 PM
Quote from: -MichaeL- on November 03, 2003, 01:58 PM
Quote from: Adron on November 03, 2003, 12:54 PM
Quote from: Grok on November 03, 2003, 11:16 AM
OK, since I don't know this technique and Adron does, I'll bow out and let him answer this question.

I don't know it, I just recognize it and have copy-pasted it from an example once or twice. If I'd known what was wrong I'd have answerred already :)

edit: (my copy-paste of it worked fine btw)
Well im glad that yours worked but early today i found out crim has start having the same problems as me could it have something to do with a virus or a virus program or some other type of program?

Periods?
if you cant understand what i write then dont respond no one told u to be a jerk did they or maybe you have no manners?

It was a suggestion for you not to look stupid, stupid.

|