Sponsored links

Go Back   MP3Car.com > Mp3Car Technical > Software & Software Development


Reply
 
Share Thread Tools Display Modes
Old 10-01-2004, 04:47 AM   #1
Variable Bitrate
 
Join Date: Sep 2000
Location: LA, CA, USA
Posts: 442
az1324
Programming Question in VB

So I wrote some code to take the map window in routis and embed it into the app i'm using without the menu and button bar etc...

Anyway, i just changed the parent of that window using setparent api call. It works great when testing on my desktop running xp but when i move it to the car which is running 98 it doesn't work. the map window disappears and the only two functions that could be causing it are movewindow or setparent. any ideas?
az1324 is offline   Reply With Quote
Advertisement
 
Advertisement
Sponsored links

Old 10-01-2004, 05:13 AM   #2
Raw Wave
 
Join Date: Jun 2004
Location: On the beach
Posts: 2,225
Gobby is on a distinguished road
Hi,

Never used the setparent or moveparent functions myself but could they be 32Bit XP only API calls?? If so, they won't work under '98.
Gobby is offline   Reply With Quote
Old 10-01-2004, 10:54 AM   #3
FLAC
 
Chairboy's Avatar
 
Join Date: Jan 2004
Posts: 1,380
Chairboy is on a distinguished road
98 is 32bit.

Run depends.exe on your application on XP and figure out which external files it's using. You probably need to update some component on your 98 machine.
__________________
Chrysler 300 - Fabricating
http://hallert.net/
Chairboy is offline   Reply With Quote
Old 10-01-2004, 04:24 PM   #4
Raw Wave
 
Join Date: Jun 2004
Location: On the beach
Posts: 2,225
Gobby is on a distinguished road
I put 32bit XP ONLY! API Calls, I didn't say that Windows 98 wasn't 32 bit.
Gobby is offline   Reply With Quote
Old 10-01-2004, 04:29 PM   #5
Super Moderator
 
xBrady's Avatar
 
Join Date: Apr 2004
Location: USA
Posts: 3,688
xBrady is a splendid one to beholdxBrady is a splendid one to beholdxBrady is a splendid one to beholdxBrady is a splendid one to beholdxBrady is a splendid one to beholdxBrady is a splendid one to beholdxBrady is a splendid one to behold
Quote: Originally Posted by UK_MP3Car
I put 32bit XP ONLY! API Calls, I didn't say that Windows 98 wasn't 32 bit.

Try this: XP only, API calls.
__________________
AMD XP 2600+/512MB RAM/120GB hard drive
Opus 150W/DVD/GPS/7" Lilliput TS/802.11g/Bluetooth
Installed.


-GPSSecure- - GPS Tracking
-AltTabber2.2.2- - Handy touchscreen utility.
xBrady is offline   Reply With Quote
Old 10-01-2004, 08:37 PM   #6
Variable Bitrate
 
Join Date: Sep 2000
Location: LA, CA, USA
Posts: 442
az1324
Now that we are done with grammar discussions, ....

SetParent Function
Minimum DLL Version user32.dll
Header Declared in Winuser.h, include Windows.h
Import library User32.lib
Minimum operating systems Windows 95, Windows NT 3.1

MoveWindow Function
Minimum DLL Version user32.dll
Header Declared in Winuser.h, include Windows.h
Import library User32.lib
Minimum operating systems Windows 95, Windows NT 3.1

Here is the code:
Code:
Option Explicit Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long Private Declare Function ShellExecute Lib "shell32" Alias "ShellExecuteA" (ByVal hwnd As Long, _ ByVal lpOperation As String, _ ByVal lpFile As String, _ ByVal lpParameters As String, _ ByVal lpDirectory As String, _ ByVal nShowCmd As Long) As Long Private Declare Function PostMessage Lib "user32" Alias "PostMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long Private Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long Private Declare Function SetParent Lib "user32.dll" (ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long Private Declare Function MoveWindow Lib "user32" (ByVal hwnd As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal bRepaint As Boolean) As Long Private Declare Function SendMessageLong& Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) Private Const WM_LBUTTONDOWN As Long = &H201 Private Const WM_CLOSE As Long = &H10 Private Const WM_LBUTTONUP As Long = &H202 Private Const WM_KEYDOWN = &H100 Private Const WM_KEYUP = &H101 Private Const VK_SPACE = &H20 Private rHwnd As Long Private okHwnd As Long Private Sub Form_Load() On Error GoTo errortrap ShellExecute 0, vbNullString, "c:\program files\routis\routis.exe", vbNullString, "c:\program files\routis", 1 Form1.Width = Screen.Width Form1.Height = Screen.Height Form1.Top = 0 Form1.Left = 0 Timer1.Interval = 500 Timer2.Interval = 500 Timer1.Enabled = True errortrap: End Sub Private Sub Form_Unload(Cancel As Integer) Call SendMessageLong(rHwnd, &H10, 0&, 0&) End Sub Private Sub Timer1_Timer() Timer1.Enabled = False rHwnd = FindWindow("#32770", "Warning") okHwnd = FindWindowEx(rHwnd, 0&, "button", "OK") SendMessage okHwnd, WM_LBUTTONDOWN, 0, 10 SendMessage okHwnd, WM_LBUTTONUP, 0, 10 Timer2.Enabled = True End Sub Private Sub Timer2_Timer() Timer2.Enabled = False If FindWindow("#32770", "Warning") <> 0 Then rHwnd = FindWindow("#32770", "Warning") okHwnd = FindWindowEx(rHwnd, 0&, "button", "OK") Call PostMessage(okHwnd, WM_KEYDOWN, VK_SPACE, 0&) Call PostMessage(okHwnd, WM_KEYUP, VK_SPACE, 0&) End If embed End Sub Private Sub embed() rHwnd = FindWindow("intellinavwcls", "Routis") okHwnd = FindWindowEx(rHwnd, 0&, "afx:400000:b:10011:6:0", vbNullString) Call SetParent(okHwnd, Me.hwnd) MoveWindow okHwnd, 0, 0, Screen.Width / Screen.TwipsPerPixelX, 7 / 8 * Screen.Height / Screen.TwipsPerPixelY, True Call ShowWindow(rHwnd, 0) End Sub

I don't think it really matters that much cause i like copilot better but it would be nice to figure out.
az1324 is offline   Reply With Quote
Old 10-01-2004, 09:00 PM   #7
I'm sorry, and you are....?
 
frodobaggins's Avatar
 
Join Date: Jan 2003
Location: Ruston, LA
Posts: 8,846
frodobaggins will become famous soon enoughfrodobaggins will become famous soon enough
Hey some of that code is mine
__________________
[H]4 Life
My next generation Front End is right on schedule.
It will be done sometime in the next generation.
I'm a lesbian too.
I am for hire!
frodobaggins is offline   Reply With Quote
Old 10-01-2004, 10:13 PM   #8
Variable Bitrate
 
Join Date: Sep 2000
Location: LA, CA, USA
Posts: 442
az1324
yeah true i based it on your source for routis launcher but it is heavily modified

Do you see any reason it wouldn't work on a 98 based system?
az1324 is offline   Reply With Quote
Sponsored links
Advertisement
 
Advertisement
Old 10-01-2004, 10:24 PM   #9
I'm sorry, and you are....?
 
frodobaggins's Avatar
 
Join Date: Jan 2003
Location: Ruston, LA
Posts: 8,846
frodobaggins will become famous soon enoughfrodobaggins will become famous soon enough
Add some debug code to print out your handles. See what's happening.
__________________
[H]4 Life
My next generation Front End is right on schedule.
It will be done sometime in the next generation.
I'm a lesbian too.
I am for hire!
frodobaggins is offline   Reply With Quote
Sponsored links
Advertisement
 
Advertisement
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
This may be more of a programming question.. but here goes bklynkaos General Hardware Discussion 1 02-09-2004 11:11 PM
Question for VB Developers Seraph Software & Software Development 3 12-26-2003 08:15 PM
Programming help needed (DirectShow & VB) All4Norway Software & Software Development 0 01-06-2003 06:42 PM
Question abou thte different VB interfaces ppl have. Red95GST Software & Software Development 1 08-02-2002 01:12 AM
Out of topic programming question (VB) darkwingduck Software & Software Development 5 09-01-2000 07:55 AM



All times are GMT -5. The time now is 07:08 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.3.2
Copyright © 1999 - 2008 Mp3Car.com Inc.Ad Management by RedTyger
Message Board Statistics