LinkBack Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #6  
Old 09-Sep-2009, 11:56 AM
Junior Member
 
Join Date: May 2008
Posts: 27
andrewmaxin 0 reputation points
Default Re: Help with C3PO.

Originally Posted by mikebell90 View Post
andrewmaxin wrote:
> andrewmaxin;1852244 Wrote:
>> Mike,
>>
>> Thanks for your response. As for your answers:
>> 1) I did use the sample wizard, and I do have a toolbar generated, but
>> it is not a distinct toolbar, it is "tacked on" to the standard toolbar.
>> Did I mess something up??
>>
>> 2) Ok, that is what Im doing now, I was trying to get around the
>> redraw.
>>
>> 3) So, does -ANYONE -know where this setting is saved? is it a Registry
>> key? is it some super-secret ini file? It HAS to be somewhere, and I
>> cant find any references in the exe. My toolbar class would simply check
>> the color code and match my component accordingly.
>>
>> Thanks again,
>>
>> Andrew

>
>
> P.S.
>
> I did some hacking around and found a file that was being written to:
>
> user.db changes upon update. By the header sig, it appears to be a
> wordperfect file (which makes no sense but whatever) ..
>
>

You caannot edit user.db except through the api
You cannot create a distinct toolbar AFAIK.
This stuff should be posted using NNTP on the groupwise developer forums.
Ok, so I have a workaround for detecting the current color scheme if anyone's interested:

Basically, instead of trying to get @ the user.db where the current scheme is likely stored, I take a screen sample at a certain point, and match the color up with existing samples, coloring my control appropriately

Code:
Private Function GetWindowPicture(ByVal hWnd As Integer) As Bitmap
        Dim g As Graphics
        Dim hdcDest As IntPtr
        Dim hdcSrc As Integer
        Dim bm As Bitmap
        Dim r As New SafeNativeMethods.RECT()
        Dim w, h As Integer

        SafeNativeMethods.GetWindowRect(hWnd, r)

        w = r.Right - r.Left
        h = r.Bottom - r.Top
        bm = New Bitmap(w, h)
        g = Graphics.FromImage(bm)

        hdcSrc = SafeNativeMethods.GetWindowDC(hWnd)
        hdcDest = g.GetHdc

        SafeNativeMethods.BitBlt(hdcDest.ToInt32, 0, 0, w, h, hdcSrc, 0, 0, SafeNativeMethods.TernaryRasterOperations.SRCCOPY)

        g.ReleaseHdc(hdcDest)
        SafeNativeMethods.ReleaseDC(hWnd, hdcSrc)

        Return bm

    End Function

    Private Sub SetColorFromWindow(ByRef p_hwnd As Integer, ByVal p_Point As Drawing.Point)

        Dim objBMP As Bitmap

        objBMP = GetWindowPicture(p_hwnd)
        'Clipboard.SetImage(objBMP)
        Dim rgbclr As System.Drawing.Color = Color.FromArgb(objBMP.GetPixel(p_Point.X, p_Point.Y).ToArgb)

        If GWThemes.ThemeBGColor(GWThemes.GroupwiseTheme.Blue) = rgbclr Then
            GWThemes.CurrentTheme = GWThemes.GroupwiseTheme.Blue
        ElseIf GWThemes.ThemeBGColor(GWThemes.GroupwiseTheme.GW65) = rgbclr Then
            GWThemes.CurrentTheme = GWThemes.GroupwiseTheme.GW65
        ElseIf GWThemes.ThemeBGColor(GWThemes.GroupwiseTheme.OliveGreen) = rgbclr Then
            GWThemes.CurrentTheme = GWThemes.GroupwiseTheme.OliveGreen
        ElseIf GWThemes.ThemeBGColor(GWThemes.GroupwiseTheme.Silver) = rgbclr Then
            GWThemes.CurrentTheme = GWThemes.GroupwiseTheme.Silver
        ElseIf GWThemes.ThemeBGColor(GWThemes.GroupwiseTheme.SkyBlue) = rgbclr Then
            GWThemes.CurrentTheme = GWThemes.GroupwiseTheme.SkyBlue
        ElseIf GWThemes.ThemeBGColor(GWThemes.GroupwiseTheme.SpringGreen) = rgbclr Then
            GWThemes.CurrentTheme = GWThemes.GroupwiseTheme.SpringGreen
        ElseIf GWThemes.ThemeBGColor(GWThemes.GroupwiseTheme.SterlingSilver) = rgbclr Then
            GWThemes.CurrentTheme = GWThemes.GroupwiseTheme.SterlingSilver
        Else
            GWThemes.CurrentTheme = GWThemes.GroupwiseTheme.GW65
        End If

    End Sub
Reply With Quote
 

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 Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -6. The time now is 07:09 AM.


© 2007 Novell, Inc. All Rights Reserved.

Search Engine Friendly URLs by vBSEO 3.3.0 RC2