Current location: Hot Scripts Forums » Programming Languages » Windows .NET Programming » [2005] StartPosition for CommonDialogs?


[2005] StartPosition for CommonDialogs?

Reply
  #1 (permalink)  
Old 05-09-08, 05:04 PM
tim8w tim8w is offline
Wannabe Coder
 
Join Date: Nov 2004
Posts: 183
Thanks: 0
Thanked 0 Times in 0 Posts
Unhappy [2005] StartPosition for CommonDialogs?

Does anyone have sample code on how to set the StartPosition for the CommonDialogs? In particular, I'm looking to create another class that inherits from ColorDialog and add the StartPosition functionality. I have seen a rather complicated way done in C# for the OpenFileDialog. Has no one done this for VB.Net yet?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 05-10-08, 04:01 AM
digioz's Avatar
digioz digioz is offline
Community VIP
 
Join Date: Oct 2003
Location: Chicago, IL
Posts: 2,167
Thanks: 3
Thanked 8 Times in 8 Posts
Not sure if this is exactly what you are looking for, but here is something to play around with. This is the VB.NET version of the following C# article found here:

http://www.codeproject.com/KB/cs/getsavefilename.aspx

In particular, take a look at the "SetWindowPos()" call in "HookProc".

Custom Dialog Form:
vb.net Code:
  1. ' 20070325: George Birbilis ([EMAIL="birbilis@kagi.com"]birbilis@kagi.com[/EMAIL])
  2. Imports System.Text
  3. Imports System.Text.Encoding
  4. Imports System.Drawing
  5. Imports System.Collections
  6. Imports System.ComponentModel
  7. Imports System.Windows.Forms
  8. Imports System.Data
  9. Imports System.Runtime.InteropServices
  10.  
  11. Public Class SaveFileDialogWithEncoding
  12.     Inherits Component
  13. #Region "Enums"
  14.     'note the order of these is important
  15.     Public Enum EncodingTypes
  16.         ANSI = 0
  17.         UTF8
  18.         UTF16
  19.         UTF7
  20.         UTF32
  21.         UNKNOWN
  22.     End Enum
  23. #End Region
  24.  
  25. #Region "Fields"
  26.     Protected Encodings As System.Text.Encoding() = New System.Text.Encoding() {ASCII, UTF8, Unicode, UTF7, UTF32}
  27.     Private m_LabelHandle As Integer = 0
  28.     Private m_ComboHandle As Integer = 0
  29.     Private m_Filter As String = ""
  30.     Private m_DefaultExt As String = ""
  31.     Private m_FileName As String = ""
  32.     Private m_EncodingType As EncodingTypes
  33.     Private m_ActiveScreen As Screen
  34. #End Region
  35.  
  36. #Region "Constants"
  37.     Private Const OFN_ENABLEHOOK As Integer = 32
  38.     Private Const OFN_EXPLORER As Integer = 524288
  39.     Private Const OFN_FILEMUSTEXIST As Integer = 4096
  40.     Private Const OFN_HIDEREADONLY As Integer = 4
  41.     Private Const OFN_CREATEPROMPT As Integer = 8192
  42.     Private Const OFN_NOTESTFILECREATE As Integer = 65536
  43.     Private Const OFN_OVERWRITEPROMPT As Integer = 2
  44.     Private Const OFN_PATHMUSTEXIST As Integer = 2048
  45.     Private Const SWP_NOSIZE As Integer = 1
  46.     Private Const SWP_NOMOVE As Integer = 2
  47.     Private Const SWP_NOZORDER As Integer = 4
  48.     Private Const WM_INITDIALOG As Integer = 272
  49.     Private Const WM_DESTROY As Integer = 2
  50.     Private Const WM_SETFONT As Integer = 48
  51.     Private Const WM_GETFONT As Integer = 49
  52.     Private Const CBS_DROPDOWNLIST As Integer = 3
  53.     Private Const CBS_HASSTRINGS As Integer = 512
  54.     Private Const CB_ADDSTRING As Integer = 323
  55.     Private Const CB_SETCURSEL As Integer = 334
  56.     Private Const CB_GETCURSEL As Integer = 327
  57.     Private Const WS_VISIBLE As UInteger = 268435456
  58.     Private Const WS_CHILD As UInteger = 1073741824
  59.     Private Const WS_TABSTOP As UInteger = 65536
  60.     Private Const CDN_FILEOK As Integer = -606
  61.     Private Const WM_NOTIFY As Integer = 78
  62. #End Region
  63.  
  64. #Region "Properties"
  65.     Public Property DefaultExt() As String
  66.         Get
  67.             Return m_DefaultExt
  68.         End Get
  69.         Set(ByVal value As String)
  70.             m_DefaultExt = value
  71.         End Set
  72.     End Property
  73.     Public Property Filter() As String
  74.         Get
  75.             Return m_Filter
  76.         End Get
  77.         Set(ByVal value As String)
  78.             m_Filter = value
  79.         End Set
  80.     End Property
  81.     Public Property FileName() As String
  82.         Get
  83.             Return m_FileName
  84.         End Get
  85.         Set(ByVal value As String)
  86.             m_FileName = value
  87.         End Set
  88.     End Property
  89.     Public Property EncodingType() As EncodingTypes
  90.         Get
  91.             Return m_EncodingType
  92.         End Get
  93.         Set(ByVal value As EncodingTypes)
  94.             m_EncodingType = value
  95.         End Set
  96.     End Property
  97.     Public Property Encoding() As Encoding
  98.         Get
  99.             Return Encodings(m_EncodingType)
  100.         End Get
  101.         Set(ByVal value As Encoding)
  102.             Dim i As Integer = 0
  103.             For Each enc As Encoding In Encodings
  104.                 If enc.Equals(value) Then
  105.                     m_EncodingType = CType(i, EncodingTypes)
  106.                     Exit Property
  107.                 End If
  108.             Next enc
  109.             m_EncodingType = EncodingTypes.UNKNOWN
  110.         End Set
  111.     End Property
  112. #End Region
  113.  
  114. #Region "Methods"
  115.     <DllImport("Comdlg32.dll", CharSet:=CharSet.Auto, SetLastError:=True)> _
  116.     Private Shared Function GetSaveFileName(ByRef lpofn As OPENFILENAME) As Boolean
  117.     End Function
  118.     <DllImport("Comdlg32.dll")> _
  119.     Private Shared Function CommDlgExtendedError() As Integer
  120.     End Function
  121.     <DllImport("user32.dll")> _
  122.     Private Shared Function SetWindowPos(ByVal hWnd As Integer, ByVal hWndInsertAfter As Integer, ByVal X As Integer, ByVal Y As Integer, ByVal cx As Integer, ByVal cy As Integer, ByVal uFlags As UInteger) As Boolean
  123.     End Function
  124.     <DllImport("user32.dll")> _
  125.     Private Shared Function GetWindowRect(ByVal hWnd As Integer, ByRef lpRect As RECT) As Boolean
  126.     End Function
  127.     <DllImport("user32.dll")> _
  128.     Private Shared Function GetParent(ByVal hWnd As Integer) As Integer
  129.     End Function
  130.     <DllImport("user32.dll", CharSet:=CharSet.Auto)> _
  131.     Private Shared Function SetWindowText(ByVal hWnd As Integer, ByVal lpString As String) As Boolean
  132.     End Function
  133.     <DllImport("user32.dll")> _
  134.     Private Overloads Shared Function SendMessage(ByVal hWnd As Integer, ByVal Msg As Integer, ByVal wParam As Integer, ByVal lParam As Integer) As Integer
  135.     End Function
  136.     <DllImport("user32.dll", CharSet:=CharSet.Auto)> _
  137.     Private Overloads Shared Function SendMessage(ByVal hWnd As Integer, ByVal Msg As Integer, ByVal wParam As Integer, ByVal lParam As String) As Integer
  138.     End Function
  139.     <DllImport("user32.dll")> _
  140.     Private Shared Function DestroyWindow(ByVal hwnd As Integer) As Boolean
  141.     End Function
  142.     <DllImport("user32.dll", CharSet:=CharSet.Auto)> _
  143.     Private Shared Function GetDlgItem(ByVal hDlg As Integer, ByVal nIDDlgItem As Integer) As Integer
  144.     End Function
  145.     <DllImport("user32.dll", CharSet:=CharSet.Auto)> _
  146.     Private Shared Function CreateWindowEx(ByVal dwExStyle As Integer, ByVal lpClassName As String, ByVal lpWindowName As String, ByVal dwStyle As UInteger, ByVal x As Integer, ByVal y As Integer, ByVal nWidth As Integer, ByVal nHeight As Integer, ByVal hWndParent As Integer, ByVal hMenu As Integer, ByVal hInstance As Integer, ByVal lpParam As Integer) As Integer
  147.     End Function
  148.     <DllImport("user32.dll")> _
  149.     Private Shared Function ScreenToClient(ByVal hWnd As Integer, ByRef lpPoint As POINT) As Boolean
  150.     End Function
  151.  
  152.     Private Function HookProc(ByVal hdlg As Integer, ByVal msg As Integer, ByVal wParam As Integer, ByVal lParam As Integer) As Integer
  153.         Select Case (msg)
  154.             Case WM_INITDIALOG
  155.                 'we need to centre the dialog
  156.                 Dim sr As Rectangle = m_ActiveScreen.Bounds
  157.                 Dim cr As RECT = New RECT
  158.                 Dim parent As Integer = GetParent(hdlg)
  159.                 GetWindowRect(parent, cr)
  160.                 Dim x As Integer = CInt((sr.Right + (sr.Left - (cr.Right - cr.Left))) / 2)
  161.                 Dim y As Integer = CInt((sr.Bottom + (sr.Top - (cr.Bottom - cr.Top))) / 2)
  162.                 SetWindowPos(parent, 0, x, y, (cr.Right - cr.Left), ((cr.Bottom - cr.Top) + 32), SWP_NOZORDER)
  163.                 'we need to find the label to position our new label under
  164.                 Dim fileTypeWindow As Integer = GetDlgItem(parent, 1089)
  165.                 Dim aboveRect As RECT = New RECT
  166.                 GetWindowRect(fileTypeWindow, aboveRect)
  167.                 'now convert the label's screen co-ordinates to client co-ordinates
  168.                 Dim point As POINT = New POINT
  169.                 point.X = aboveRect.Left
  170.                 point.Y = aboveRect.Bottom
  171.                 ScreenToClient(parent, point)
  172.                 'create the label
  173.                 Dim labelHandle As Integer = CreateWindowEx(0, "STATIC", "mylabel", (WS_VISIBLE _
  174.                                         Or (WS_CHILD Or WS_TABSTOP)), point.X, (point.Y + 12), 200, 100, parent, 0, 0, 0)
  175.                 SetWindowText(labelHandle, "&Encoding:") 'should show with same encoding as system dialog or not show label at all
  176.                 Dim fontHandle As Integer = SendMessage(fileTypeWindow, WM_GETFONT, 0, 0)
  177.                 SendMessage(labelHandle, WM_SETFONT, fontHandle, 0)
  178.                 'we now need to find the combo-box to position the new combo-box under
  179.                 Dim fileComboWindow As Integer = GetDlgItem(parent, 1136)
  180.                 aboveRect = New RECT
  181.                 GetWindowRect(fileComboWindow, aboveRect)
  182.                 point = New POINT
  183.                 point.X = aboveRect.Left
  184.                 point.Y = aboveRect.Bottom
  185.                 ScreenToClient(parent, point)
  186.                 Dim rightPoint As POINT = New POINT
  187.                 rightPoint.X = aboveRect.Right
  188.                 rightPoint.Y = aboveRect.Top
  189.                 ScreenToClient(parent, rightPoint)
  190.                 'we create the new combobox
  191.                 Dim comboHandle As Integer = CreateWindowEx(0, "ComboBox", "mycombobox", (WS_VISIBLE _
  192.                                         Or (WS_CHILD _
  193.                                         Or (CBS_HASSTRINGS _
  194.                                         Or (CBS_DROPDOWNLIST Or WS_TABSTOP)))), point.X, (point.Y + 8), (rightPoint.X - point.X), 100, parent, 0, 0, 0)
  195.                 SendMessage(comboHandle, WM_SETFONT, fontHandle, 0)
  196.                 'and add the encodings we want to offer
  197.                 SendMessage(comboHandle, CB_ADDSTRING, 0, "ANSI")
  198.                 SendMessage(comboHandle, CB_ADDSTRING, 0, "Unicode (UTF-8)")
  199.                 SendMessage(comboHandle, CB_ADDSTRING, 0, "Unicode (UTF-16)")
  200.                 SendMessage(comboHandle, CB_ADDSTRING, 0, "Unicode (UTF-7)")
  201.                 SendMessage(comboHandle, CB_ADDSTRING, 0, "Unicode (UTF-32)")
  202.                 SendMessage(comboHandle, CB_SETCURSEL, CType(m_EncodingType, Integer), 0)
  203.                 'remember the handles of the controls we have created so we can destroy them after
  204.                 m_LabelHandle = labelHandle
  205.                 m_ComboHandle = comboHandle
  206.             Case WM_DESTROY
  207.                 'destroy the handles we have created
  208.                 If (m_ComboHandle <> 0) Then
  209.                     DestroyWindow(m_ComboHandle)
  210.                 End If
  211.                 If (m_LabelHandle <> 0) Then
  212.                     DestroyWindow(m_LabelHandle)
  213.                 End If
  214.             Case WM_NOTIFY
  215.                 'we need to intercept the CDN_FILEOK message
  216.                 'which is sent when the user selects a filename
  217.                 Dim nmhdr As NMHDR = CType(Marshal.PtrToStructure(New IntPtr(lParam), GetType(NMHDR)), NMHDR)
  218.                 If (nmhdr.Code = CDN_FILEOK) Then
  219.                     'a file has been selected
  220.                     'we need to get the encoding
  221.                     m_EncodingType = CType(SendMessage(m_ComboHandle, CB_GETCURSEL, 0, 0), EncodingTypes)
  222.                 End If
  223.         End Select
  224.         Return 0
  225.     End Function
  226.  
  227.     Public Function ShowDialog() As DialogResult
  228.         'set up the struct and populate it
  229.         Dim ofn As OPENFILENAME = New OPENFILENAME
  230.         ofn.lStructSize = Marshal.SizeOf(ofn)
  231.         ofn.lpstrFilter = (m_Filter.Replace("|", Microsoft.VisualBasic.Chr(0)) + Microsoft.VisualBasic.Chr(0))
  232.         ofn.lpstrFile = (m_FileName + New String(Microsoft.VisualBasic.Chr(32), 512))
  233.         ofn.nMaxFile = ofn.lpstrFile.Length
  234.         ofn.lpstrFileTitle = (System.IO.Path.GetFileName(m_FileName) + New String(Microsoft.VisualBasic.Chr(32), 512))
  235.         ofn.nMaxFileTitle = ofn.lpstrFileTitle.Length
  236.         ofn.lpstrTitle = "Save file as"
  237.         ofn.lpstrDefExt = m_DefaultExt
  238.         'position the dialog above the active window
  239.         ofn.hwndOwner = Form.ActiveForm.Handle
  240.         'we need to find out the active screen so the dialog box is
  241.         'centred on the correct display
  242.         m_ActiveScreen = Screen.FromControl(Form.ActiveForm)
  243.         'set up some sensible flags
  244.         ofn.Flags = (OFN_EXPLORER _
  245.                           Or (OFN_PATHMUSTEXIST _
  246.                           Or (OFN_NOTESTFILECREATE _
  247.                           Or (OFN_ENABLEHOOK _
  248.                           Or (OFN_HIDEREADONLY Or OFN_OVERWRITEPROMPT)))))
  249.         'this is where the hook is set. Note that we can use a C# delegate in place of a C function pointer
  250.         ofn.lpfnHook = New OFNHookProcDelegate(AddressOf HookProc)
  251.         'if we're running on Windows 98/ME then the struct is smaller
  252.         If (System.Environment.OSVersion.Platform <> PlatformID.Win32NT) Then
  253.             ofn.lStructSize = (ofn.lStructSize - 12)
  254.         End If
  255.         'show the dialog
  256.         If Not GetSaveFileName(ofn) Then
  257.             Dim ret As Integer = CommDlgExtendedError()
  258.             If (ret <> 0) Then
  259.                 Throw New ApplicationException(("Couldn't show file open dialog - " + ret.ToString))
  260.             End If
  261.             Return DialogResult.Cancel
  262.         End If
  263.         'Birb-start
  264.         Dim oldFilename As String = m_FileName
  265.         m_FileName = ofn.lpstrFile
  266.         Dim cancelCheck As New CancelEventArgs()
  267.         RaiseEvent FileOK(Me, cancelCheck)
  268.         If cancelCheck.Cancel Then
  269.             m_FileName = oldFilename 'restore filename since dialog was canceled
  270.             Return DialogResult.Cancel
  271.         Else
  272.             Return DialogResult.OK
  273.         End If
  274.         'Birb-end
  275.     End Function
  276.     Public Delegate Function OFNHookProcDelegate(ByVal hdlg As Integer, ByVal msg As Integer, ByVal wParam As Integer, ByVal lParam As Integer) As Integer
  277. #End Region
  278.  
  279. #Region "Structures"
  280.     <StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Auto)> _
  281.     Private Structure OPENFILENAME
  282.         Public lStructSize As Integer
  283.         Public hwndOwner As IntPtr
  284.         Public hInstance As Integer
  285.         <MarshalAs(UnmanagedType.LPTStr)> _
  286.      Public lpstrFilter As String
  287.         <MarshalAs(UnmanagedType.LPTStr)> _
  288.      Public lpstrCustomFilter As String
  289.         Public nMaxCustFilter As Integer
  290.         Public nFilterIndex As Integer
  291.         <MarshalAs(UnmanagedType.LPTStr)> _
  292.      Public lpstrFile As String
  293.         Public nMaxFile As Integer
  294.         <MarshalAs(UnmanagedType.LPTStr)> _
  295.      Public lpstrFileTitle As String
  296.         Public nMaxFileTitle As Integer
  297.         <MarshalAs(UnmanagedType.LPTStr)> _
  298.      Public lpstrInitialDir As String
  299.         <MarshalAs(UnmanagedType.LPTStr)> _
  300.      Public lpstrTitle As String
  301.         Public Flags As Integer
  302.         Public nFileOffset As Short
  303.         Public nFileExtension As Short
  304.         <MarshalAs(UnmanagedType.LPTStr)> _
  305.      Public lpstrDefExt As String
  306.         Public lCustData As Integer
  307.         Public lpfnHook As OFNHookProcDelegate
  308.         <MarshalAs(UnmanagedType.LPTStr)> _
  309.      Public lpTemplateName As String
  310.         'only if on nt 5.0 or higher
  311.         Public pvReserved As Integer
  312.         Public dwReserved As Integer
  313.         Public FlagsEx As Integer
  314.     End Structure
  315.     Private Structure RECT
  316.         Public Left As Integer
  317.         Public Top As Integer
  318.         Public Right As Integer
  319.         Public Bottom As Integer
  320.     End Structure
  321.     Private Structure POINT
  322.         Public X As Integer
  323.         Public Y As Integer
  324.     End Structure
  325.     Private Structure NMHDR
  326.         Public HwndFrom As Integer
  327.         Public IdFrom As Integer
  328.         Public Code As Integer
  329.     End Structure
  330. #End Region
  331. #Region "Events"
  332.     Public Event FileOK(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs) 'Birb
  333. #End Region
  334. End Class

Sample Usage:
vb.net Code:
  1. Dim ofd As SaveFileDialogWithEncoding = New SaveFileDialogWithEncoding
  2.         ofd.DefaultExt = "sql"
  3.         ofd.EncodingType = SaveFileDialogWithEncoding.EncodingTypes.UTF8
  4.         ofd.Filter = "SQL files (*.sql)|*.sql|All files (*.*)|*.*"
  5.         If (ofd.ShowDialog = DialogResult.OK) Then
  6.             MessageBox.Show(String.Format("Name={0}, Encoding={1}", ofd.FileName, ofd.EncodingType))
  7.         End If

This won't run in .NET 2.0 due to the change in the way .NET 2.0 handles threading. You will have to rewrite it to use a delegate to work in .NET 2.0.

Another very good example of using hooks can be found in this article:

http://msdn.microsoft.com/en-us/magazine/cc188920.aspx

Let me know if this helps. I am very curious to see what you will make of this.


Pete
__________________
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 05-23-08, 03:46 PM
tim8w tim8w is offline
Wannabe Coder
 
Join Date: Nov 2004
Posts: 183
Thanks: 0
Thanked 0 Times in 0 Posts
Re: StartPosition for CommonDialogs

Pete,
That's the example I used for GetOpenFileName, GetSaveFileName and ChooseColor dialogs. ChooseFont is much more complicated and I haven't been able to get it to work yet based on this example...

Thanks for the effort!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #4 (permalink)  
Old 05-25-08, 01:56 PM
digioz's Avatar
digioz digioz is offline
Community VIP
 
Join Date: Oct 2003
Location: Chicago, IL
Posts: 2,167
Thanks: 3
Thanked 8 Times in 8 Posts
lol ... ok. I will let you know if I come across anything else on ChooseFont.

By the way, whenever I go to directly reference the "comdlg32.dll" in "system32 folder, I get the following error (VS 2005):

comdlg32_dll_error.jpg

Have you ever come across this error? If so how did you fix it?


Pete
__________________

Last edited by digioz; 05-25-08 at 03:13 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #5 (permalink)  
Old 12-08-08, 11:20 AM
loumarco loumarco is offline
New Member
 
Join Date: Dec 2008
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Thankx for the VB.NET example

Thank you for this example. I'm learning quite a bit!

I'm trying to run this example under Vista/VS2008/.NET 2.0. I can change the title of the dialog but the label nor the dropdown appears.

Any one here have issues with this example running under Vista?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #6 (permalink)  
Old 12-09-08, 11:41 AM
digioz's Avatar
digioz digioz is offline
Community VIP
 
Join Date: Oct 2003
Location: Chicago, IL
Posts: 2,167
Thanks: 3
Thanked 8 Times in 8 Posts
Quote:
Originally Posted by loumarco View Post
Thank you for this example. I'm learning quite a bit!

I'm trying to run this example under Vista/VS2008/.NET 2.0. I can change the title of the dialog but the label nor the dropdown appears.

Any one here have issues with this example running under Vista?
Sorry, I actually had trouble with running it on Vista myself. Tim would be the guy to ask about this, since he got it working correctly. Send him a PM and ask what his solution was.

Pete
__________________
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #7 (permalink)  
Old 12-12-08, 12:00 PM
tim8w tim8w is offline
Wannabe Coder
 
Join Date: Nov 2004
Posts: 183
Thanks: 0
Thanked 0 Times in 0 Posts
Cool

digioz, loumarco;
The code I finally ended up with is for VS2005 and has only been tested on XP. If you want to e-mail me I can send the code to you and you can test it with VS2008 and Vista...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #8 (permalink)  
Old 12-12-08, 02:17 PM
digioz's Avatar
digioz digioz is offline
Community VIP
 
Join Date: Oct 2003
Location: Chicago, IL
Posts: 2,167
Thanks: 3
Thanked 8 Times in 8 Posts
Quote:
Originally Posted by tim8w View Post
digioz, loumarco;
The code I finally ended up with is for VS2005 and has only been tested on XP. If you want to e-mail me I can send the code to you and you can test it with VS2008 and Vista...
Ah, ok. So you didn't get it to run on Vista either.

Thanks,
Pete
__________________
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #9 (permalink)  
Old 12-12-08, 07:11 PM
tim8w tim8w is offline
Wannabe Coder
 
Join Date: Nov 2004
Posts: 183
Thanks: 0
Thanked 0 Times in 0 Posts
Smile

Not exactly didn't get it to run on Vista, never even tried it in VS2008 or Vista...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #10 (permalink)  
Old 12-17-08, 09:14 PM
digioz's Avatar
digioz digioz is offline
Community VIP
 
Join Date: Oct 2003
Location: Chicago, IL
Posts: 2,167
Thanks: 3
Thanked 8 Times in 8 Posts
Tim,

You will be happy to know that your source code converted from VS 2005 to VS 2008 without any error, and runs fine on Vista. Its only when you try to code it on Vista from scratch that you get the error described for some reason.

Pete
__________________
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] [2005] How to combine PictureBox's Image and BackColor? tim8w Windows .NET Programming 1 04-25-08 05:26 PM
[SOLVED] [2005] ComboBox: Relation between ItemHeight and MaxDropDownItems? tim8w Windows .NET Programming 3 04-23-08 01:56 AM
[SOLVED] [2005] ToolStripComboBox with Font Styles? tim8w Windows .NET Programming 1 04-21-08 12:10 PM
[SOLVED] [2005] VB6-like AutoRefesh for PictureBox control? tim8w Windows .NET Programming 1 04-16-08 06:21 PM
[SOLVED] [2005] CustomButtonControl - Defaults declared in New overriding values tim8w Windows .NET Programming 1 02-25-08 02:12 PM


All times are GMT -5. The time now is 10:34 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.