Click here to Skip to main content
15,897,187 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionSet Wallpaper Pin
Pasan14831-Mar-09 5:23
Pasan14831-Mar-09 5:23 
AnswerRe: Set Wallpaper Pin
0x3c031-Mar-09 6:39
0x3c031-Mar-09 6:39 
QuestionOn Error GoTo in VBScript Pin
ATM_Guy31-Mar-09 4:59
ATM_Guy31-Mar-09 4:59 
AnswerRe: On Error GoTo in VBScript Pin
riced31-Mar-09 5:26
riced31-Mar-09 5:26 
GeneralRe: On Error GoTo in VBScript Pin
Uros Calakovic31-Mar-09 6:57
Uros Calakovic31-Mar-09 6:57 
QuestionProblem with movetoroot from the opc da automation wrapper Pin
dadio2531-Mar-09 3:53
dadio2531-Mar-09 3:53 
AnswerRe: Problem with movetoroot from the opc da automation wrapper Pin
dadio251-Apr-09 20:47
dadio251-Apr-09 20:47 
GeneralDisplay External Window in vb Form Pin
Samir Ibrahim31-Mar-09 2:48
Samir Ibrahim31-Mar-09 2:48 
Hi All

I have a working code written in VFP http://www.foxite.com/archives/use-notepad-on-a-scx-0000129391.htm[^]

I tried to convert it to Vb.Net but I get stuck in error appearing whatever I do

Declare Function SetParent Lib "user32" (ByVal hWndChild As IntPtr, ByVal hWndNewParent As IntPtr) As IntPtr
Declare Function WinExec Lib "kernel32" (ByVal lpCmdLine As String, ByVal nCmdShow As Long) As Long
Declare Function FindWindow Lib "user32" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim nHwnd As Long
        ' run notepad
        WinExec("notepad.exe", 1)
        ' find its hwnd
        nHwnd = FindWindow(Nothing, "Untitled - Notepad") ' <-- Error

        ' Note you must supply the EXACT Caption of the window)
        ' force it inside our form
        SetParent(nHwnd, Me.Handle.ToInt32)
        ' size it
        Dim nLeft, nTop, nWidth, nHeight As Integer
        nLeft = Me.Panel11.Left
        nTop = Me.Panel11.Top
        nWidth = Me.Panel11.Width
        nHeight = Me.Panel11.Height
        SetWindowPos(nHwnd, 1, nLeft, nTop, nWidth, nHeight, 64)

    End Sub


Error Message : "Arithmetic operation resulted in an overflow"

I tried to add Panel, and command button and picture same result.

Could some one check it please,

And is there is better idea to show external window such as Excel or Word.

Like car accidents, most hardware problems are due to driver error.

Samir R. Ibrahim

GeneralRe: Display External Window in vb Form Pin
Dave Kreskowiak31-Mar-09 3:23
mveDave Kreskowiak31-Mar-09 3:23 
GeneralRe: Display External Window in vb Form Pin
Samir Ibrahim31-Mar-09 4:05
Samir Ibrahim31-Mar-09 4:05 
GeneralRe: Display External Window in vb Form Pin
0x3c031-Mar-09 6:55
0x3c031-Mar-09 6:55 
GeneralRe: Display External Window in vb Form Pin
Dave Kreskowiak31-Mar-09 7:26
mveDave Kreskowiak31-Mar-09 7:26 
GeneralRe: Display External Window in vb Form Pin
Samir Ibrahim1-Apr-09 5:07
Samir Ibrahim1-Apr-09 5:07 
QuestionFind Window Pin
Prasadsm31-Mar-09 1:38
Prasadsm31-Mar-09 1:38 
AnswerRe: Find Window Pin
Eddy Vluggen31-Mar-09 1:56
professionalEddy Vluggen31-Mar-09 1:56 
GeneralRe: Find Window Pin
Prasadsm31-Mar-09 2:01
Prasadsm31-Mar-09 2:01 
GeneralRe: Find Window Pin
Eddy Vluggen31-Mar-09 2:35
professionalEddy Vluggen31-Mar-09 2:35 
QuestionDelete Lines in Text File Pin
vijay248230-Mar-09 23:37
vijay248230-Mar-09 23:37 
AnswerRe: Delete Lines in Text File Pin
Prasadsm31-Mar-09 2:15
Prasadsm31-Mar-09 2:15 
AnswerRe: Delete Lines in Text File Pin
riced31-Mar-09 5:21
riced31-Mar-09 5:21 
QuestionI created a superscript in a rich text box but neeed to convert the same to caret sign in a text box Pin
gautamrajsaxena30-Mar-09 22:18
gautamrajsaxena30-Mar-09 22:18 
Questionplz help me to jump the return code to pass program check Pin
wgarnett30-Mar-09 21:37
wgarnett30-Mar-09 21:37 
AnswerRe: plz help me to jump the return code to pass program check Pin
Eddy Vluggen30-Mar-09 22:58
professionalEddy Vluggen30-Mar-09 22:58 
QuestionHow to configure ms access to allow lan connection in vb.net ???? Pin
JC.KaNNaN30-Mar-09 18:43
JC.KaNNaN30-Mar-09 18:43 
AnswerRe: How to configure ms access to allow lan connection in vb.net ???? Pin
_Damian S_30-Mar-09 19:12
professional_Damian S_30-Mar-09 19:12 

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.