Click here to Skip to main content
15,899,124 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionCall Keypress Pin
Anybloodyid3-Mar-07 5:14
Anybloodyid3-Mar-07 5:14 
AnswerRe: Call Keypress Pin
JUNEYT3-Mar-07 5:32
JUNEYT3-Mar-07 5:32 
AnswerRe: Call Keypress Pin
Dave Kreskowiak3-Mar-07 6:37
mveDave Kreskowiak3-Mar-07 6:37 
GeneralRe: Call Keypress Pin
Anybloodyid3-Mar-07 10:55
Anybloodyid3-Mar-07 10:55 
GeneralRe: Call Keypress Pin
Dave Kreskowiak3-Mar-07 13:14
mveDave Kreskowiak3-Mar-07 13:14 
GeneralRe: Call Keypress Pin
Anybloodyid3-Mar-07 22:08
Anybloodyid3-Mar-07 22:08 
QuestionVB.net and GetForegroundWindow Issues/Bug??? Pin
brentleim13-Mar-07 4:58
brentleim13-Mar-07 4:58 
AnswerRe: VB.net and GetForegroundWindow Issues/Bug??? Pin
Dave Kreskowiak3-Mar-07 6:25
mveDave Kreskowiak3-Mar-07 6:25 
We need to see the Declaration of the GetForgroundWindow function. I get the feeling you just used the VB6 code without any conversion. The problem most people run into is that they don't know the difference between a VB6 Long type and a VB.NET Long.

In VB6, a Long is a standard 32-bit signed integer. In VB.NET, Long is a 64-bit signed integer. A VERY different number with different storage requirements.

For handles, you should be using the IntPtr type in VB.NET. So, for GetForegroundWindow, the Declare should be:
    Private Declare Auto Function GetForegroundWindow Lib "user32" () As IntPtr
.
.
.
    Dim foreWndHandle As IntPtr = GetForegroundWindow()



Dave Kreskowiak
Microsoft MVP - Visual Basic


GeneralRe: VB.net and GetForegroundWindow Issues/Bug??? [modified] Pin
brentleim13-Mar-07 8:20
brentleim13-Mar-07 8:20 
GeneralRe: VB.net and GetForegroundWindow Issues/Bug??? Pin
Dave Kreskowiak3-Mar-07 10:29
mveDave Kreskowiak3-Mar-07 10:29 
GeneralRe: VB.net and GetForegroundWindow Issues/Bug??? Pin
brentleim13-Mar-07 10:56
brentleim13-Mar-07 10:56 
GeneralRe: VB.net and GetForegroundWindow Issues/Bug??? Pin
brentleim13-Mar-07 12:43
brentleim13-Mar-07 12:43 
GeneralRe: VB.net and GetForegroundWindow Issues/Bug??? Pin
Dave Kreskowiak3-Mar-07 13:29
mveDave Kreskowiak3-Mar-07 13:29 
GeneralRe: VB.net and GetForegroundWindow Issues/Bug??? Pin
Dave Kreskowiak3-Mar-07 13:26
mveDave Kreskowiak3-Mar-07 13:26 
Question[Message Deleted] Pin
harveyhanson3-Mar-07 2:46
harveyhanson3-Mar-07 2:46 
AnswerRe: Easy one (I hope) Pin
JUNEYT3-Mar-07 2:53
JUNEYT3-Mar-07 2:53 
AnswerRe: Easy one (I hope) Pin
kubben3-Mar-07 4:30
kubben3-Mar-07 4:30 
Questionreading data from a barcode reader Pin
moseti3-Mar-07 2:29
moseti3-Mar-07 2:29 
AnswerRe: reading data from a barcode reader Pin
mr_lasseter3-Mar-07 4:05
mr_lasseter3-Mar-07 4:05 
AnswerRe: reading data from a barcode reader Pin
steve_rm3-Mar-07 6:09
steve_rm3-Mar-07 6:09 
QuestionImporting data from Foxpro to MS-Access Pin
hisuman1003-Mar-07 0:59
hisuman1003-Mar-07 0:59 
QuestionUrgent..SOS...SOS... Pin
NANCO3-Mar-07 0:57
NANCO3-Mar-07 0:57 
AnswerRe: Urgent..SOS...SOS... Pin
JUNEYT3-Mar-07 2:14
JUNEYT3-Mar-07 2:14 
AnswerRe: Urgent..SOS...SOS... Pin
Dave Kreskowiak3-Mar-07 6:15
mveDave Kreskowiak3-Mar-07 6:15 
GeneralRe: Urgent..SOS...SOS... Pin
TwoFaced3-Mar-07 8:25
TwoFaced3-Mar-07 8:25 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.