Results 1 to 3 of 3

Thread: HOw to show external application modally...

  1. #1

    Thread Starter
    Frenzied Member moinkhan's Avatar
    Join Date
    Jun 2000
    Location
    Karachi, Pakistan
    Posts
    2,011

    HOw to show external application modally...

    I am calling ODBC Administrator and OLEDB Connection String Builder from my code... I want these external windows to be opened modally... i remember i have done it before.. just lost now..

    below is my code for ODBC Administrator

    VB Code:
    1. Shell "rundll32.exe shell32.dll,Control_RunDLL odbccp32.cpl", vbHide
    2. Dim ret&
    3. ret = FindWindow(vbNullString, "ODBC Data Source Administrator")
    4. SetWindowPos ret, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOACTIVATE Or SWP_SHOWWINDOW Or SWP_NOMOVE Or SWP_NOSIZE


    and for OLEDB


    VB Code:
    1. Dim X As New DataLinks
    2. Private Sub cmdBuild_Click(Index As Integer)
    3. Set myCon(Index) = X.PromptNew
    4. txtOLEDB(Index).Text = myCon(Index).connectionString
    5. End Sub

    I want both of these window to open Modally so the user cannot work on my applicatoin until these forms are closed...

    Any Ideas?

  2. #2
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    Re: HOw to show external application modally...

    For the latter set the hWnd property of the DataLinks object.
    VB Code:
    1. X.hWnd = Me.hWnd
    2. Set myCon(Index) = X.PromptNew

  3. #3

    Thread Starter
    Frenzied Member moinkhan's Avatar
    Join Date
    Jun 2000
    Location
    Karachi, Pakistan
    Posts
    2,011

    Re: HOw to show external application modally...

    Quote Originally Posted by Joacim Andersson
    For the latter set the hWnd property of the DataLinks object.
    VB Code:
    1. X.hWnd = Me.hWnd
    2. Set myCon(Index) = X.PromptNew

    thanx dude.. it works great.. and what about ODBC thing?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width