Click here to Skip to main content
16,018,938 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: keypress in datagrid Pin
kalyanforums@yahoo.com6-Jul-05 1:06
kalyanforums@yahoo.com6-Jul-05 1:06 
GeneralRe: keypress in datagrid Pin
makeko6-Jul-05 4:11
makeko6-Jul-05 4:11 
GeneralRetrieve data from an XML *.config file. Pin
Brad Fackrell5-Jul-05 15:00
Brad Fackrell5-Jul-05 15:00 
GeneralRe: Retrieve data from an XML *.config file. Pin
Brad Fackrell6-Jul-05 2:46
Brad Fackrell6-Jul-05 2:46 
GeneralCant get GetTitleBarInfo working properly... Pin
AndrewVos5-Jul-05 11:44
AndrewVos5-Jul-05 11:44 
GeneralRe: Cant get GetTitleBarInfo working properly... Pin
Anonymous5-Jul-05 14:38
Anonymous5-Jul-05 14:38 
GeneralRe: Cant get GetTitleBarInfo working properly... Pin
Anonymous5-Jul-05 15:39
Anonymous5-Jul-05 15:39 
GeneralRe: Cant get GetTitleBarInfo working properly... Pin
AndrewVos6-Jul-05 2:07
AndrewVos6-Jul-05 2:07 
Still not working... The elements of rgstate() are all = 0.
Consider this code....
<br />
        Private Class TitleBarInfo<br />
            <System.Runtime.InteropServices.DllImport("user32")> Private Shared Function GetTitleBarInfo(ByVal hWnd As IntPtr, ByRef pti As TITLEBARINFO) As Boolean<br />
            End Function<br />
<br />
            Private Const STATE_SYSTEM_FOCUSABLE As Integer = &H100000<br />
            Private Const STATE_SYSTEM_INVISIBLE As Short = &H8000S<br />
            Private Const STATE_SYSTEM_OFFSCREEN As Integer = &H10000<br />
            Private Const STATE_SYSTEM_UNAVAILABLE As Short = &H1S<br />
            Private Const STATE_SYSTEM_PRESSED As Short = &H8S<br />
            Private Const CCHILDREN_TITLEBAR As Short = 5<br />
            Public Structure RECT<br />
                Public left As Integer<br />
                Public top As Integer<br />
                Public right As Integer<br />
                Public bottom As Integer<br />
            End Structure<br />
            <StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Ansi)> Private Structure TITLEBARINFO<br />
                Dim cbSize As Integer<br />
                Dim rcTitleBar As RECT<br />
                <MarshalAs(UnmanagedType.ByValArray, SizeConst:=CCHILDREN_TITLEBAR + 1)> Dim rgstate() As Integer<br />
                Public Sub Initialize()<br />
                    ReDim rgstate(CCHILDREN_TITLEBAR + 1)<br />
                End Sub<br />
            End Structure<br />
<br />
            Private Shared Function GetTitleBarInfo(ByVal Handle As IntPtr) As TITLEBARINFO<br />
                Dim TitleInfo As TITLEBARINFO<br />
                'Initialize structure<br />
<br />
                TitleInfo.Initialize()<br />
                TitleInfo.cbSize = Len(TitleInfo)<br />
<br />
                ' GetTitleBarInfo(Handle, TitleInfo)<br />
                GetTitleBarInfo(Handle, TitleInfo)<br />
                'Show some of that information<br />
                Return TitleInfo<br />
            End Function<br />
           <br />
<br />
            Public Shared ReadOnly Property CaptionButtonCount(ByVal Handle As IntPtr) As Integer<br />
                Get<br />
                    Dim count As Integer<br />
<br />
                    Dim tbi As TITLEBARINFO<br />
                    tbi = GetTitleBarInfo(Handle)<br />
<br />
                    'Index  TitleBar Element<br />
                    '0      The title bar itself. <br />
                    '1      Reserved. <br />
                    '2      Minimize button. <br />
                    '3      Maximize button. <br />
                    '4      Help button. <br />
                    '5      Close button. <br />
                    Dim x As Integer<br />
                    For x = 2 To 5<br />
                        If Not (tbi.rgstate(x) = STATE_SYSTEM_INVISIBLE) And Not tbi.rgstate(x) = 0 Then<br />
                            count += 1<br />
                        End If<br />
                    Next x<br />
                    Return count<br />
                End Get<br />
            End Property<br />
<br />
        End Class<br />
<br />

GeneralRe: Cant get GetTitleBarInfo working properly... Pin
AndrewVos6-Jul-05 2:12
AndrewVos6-Jul-05 2:12 
GeneralRe: Cant get GetTitleBarInfo working properly... Pin
AndrewVos6-Jul-05 3:13
AndrewVos6-Jul-05 3:13 
GeneralRe: Cant get GetTitleBarInfo working properly... Pin
Anonymous6-Jul-05 9:12
Anonymous6-Jul-05 9:12 
GeneralRe: Cant get GetTitleBarInfo working properly... Pin
Anonymous7-Jul-05 4:14
Anonymous7-Jul-05 4:14 
GeneralRe: Cant get GetTitleBarInfo working properly... Pin
AndrewVos7-Jul-05 4:40
AndrewVos7-Jul-05 4:40 
GeneralRe: Cant get GetTitleBarInfo working properly... Pin
Anonymous7-Jul-05 10:19
Anonymous7-Jul-05 10:19 
GeneralRegistry Entry (SaveSettings) Pin
Mtognetti5-Jul-05 10:35
Mtognetti5-Jul-05 10:35 
GeneralRe: Registry Entry (SaveSettings) Pin
Dave Kreskowiak6-Jul-05 2:59
mveDave Kreskowiak6-Jul-05 2:59 
GeneralRe: Registry Entry (SaveSettings) Pin
Anonymous6-Jul-05 8:24
Anonymous6-Jul-05 8:24 
GeneralSet folder permissions -- PLEASE HELP! Pin
spelltwister5-Jul-05 9:25
spelltwister5-Jul-05 9:25 
QuestionIs the IF statement the best choice for this? Pin
btoyer5-Jul-05 9:15
btoyer5-Jul-05 9:15 
AnswerRe: Is the IF statement the best choice for this? Pin
Anonymous5-Jul-05 9:29
Anonymous5-Jul-05 9:29 
GeneralErrorProvider: Clear ALL Pin
Brad Fackrell5-Jul-05 9:07
Brad Fackrell5-Jul-05 9:07 
GeneralRe: ErrorProvider: Clear ALL Pin
Anonymous5-Jul-05 11:26
Anonymous5-Jul-05 11:26 
QuestionStringFormat.Format16bppArgb1555 ? Pin
[Marc]5-Jul-05 8:36
[Marc]5-Jul-05 8:36 
AnswerI mean PixelFormat.Format16bppArgb1555 Pin
[Marc]5-Jul-05 16:23
[Marc]5-Jul-05 16:23 
QuestionHow to Share data b/t parent and child form ? Pin
Madni Abbasi5-Jul-05 3:51
Madni Abbasi5-Jul-05 3:51 

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.