星期五, 八月 29, 2008

Interesting idea about a borderless button, which is actually a checkbox. the only problem so far is that when the button is clicked, for some reason it shows white background, need to find that setting.

Borderless Button - .NET C#: "- Don't use a Button control, but a CheckBox control.

- At design time, set the following properties:
-- Appearance = Button
-- FlatAppearance.BorderColor = whatever you like
-- FlatAppearance.BorderSize = 0
-- FlatAppearance.MouseDownBackColor = whatever you like
-- FlatAppearance.MouseOverBackColor = whatever you like
-- FlatStyle = Flat"

星期五, 八月 22, 2008

EnTech Taiwan | Utilities | PowerStrip

EnTech Taiwan | Utilities | PowerStrip

interesting tool to make windows display under any resolution(?)
Graphics.GetHalftonePalette Method (System.Drawing)

Override and use HalftonePalette can fix some display problem for c# controls under 256 color mode(RDP)

[System.Runtime.InteropServices.DllImportAttribute("gdi32.dll")]
private static extern IntPtr SelectPalette(IntPtr hdc, IntPtr htPalette, bool bForceBackground);

[System.Runtime.InteropServices.DllImportAttribute("gdi32.dll")]
private static extern int RealizePalette(IntPtr hdc);

protected override void OnPaint(PaintEventArgs e)
{
IntPtr hdc = e.Graphics.GetHdc();

// Get handle to halftone palette.
IntPtr htPalette = Graphics.GetHalftonePalette();

// Select and realize new palette.
SelectPalette(hdc, htPalette, true);
RealizePalette(hdc);
e.Graphics.ReleaseHdc(hdc);

base.OnPaint(e);
}

星期三, 八月 20, 2008

Enable a service from command line | Generic Geek.Com

Enable a service from command line | Generic Geek.Com: "sc config servicename start= auto
net start servicename"

Found that some time RDP clipbook doesnt work since the service is disabled, use above name with actual service name (not display name) to set it to auto then start it. Also for clipbook, you need to make sure to start network DSDM(?) first then network DDE.

星期一, 八月 18, 2008

Windows XP drivers for Acer Aspire One

Windows XP drivers for Acer Aspire One
512M and 8G SSD will barely work for xp, but as they are only selling this now... maybe I should just wait for xp version and cheaper price. also 1024x600 seems too low, still like 1280x720 and higher for laptop those days.

ftp://ftp.work.acer-euro.com/notebook/aspire_one_150/driver/

星期三, 八月 06, 2008

WD2002: On-Screen Symbol and Standard Keyboards Are Still Available After You Remove Handwriting Recognition Feature

dont install office 2002 components with wrong options (handwriting etc) as you cant uninstall some of it!

http://kbalertz.com/282599/CTFMON.aspx
this link mentions TIP (text input processor), I happen to see CTF\TIP registry entry today. so I checked HKLM, problem solved!

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\CTF\TIP\{F89E9E58-BD2F-4008-9AC2-0F816C09F4EE}]
...
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\CTF\TIP\{F89E9E58-BD2F-4008-9AC2-0F816C09F4EE}\Category\Item\{F89E9E58-BD2F-4008-9AC2-0F816C09F4EE}]
"Description"="On-screen keyboard"

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\CTF\TIP\{F89E9E58-BD2F-4008-9AC2-0F816C09F4EE}\Category\Item\{F89E9E58-BD2F-4008-9AC2-0F816C09F4EE}\{246ECB87-C2F2-4ABE-905B-C8B38ADD2C43}]

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\CTF\TIP\{F89E9E58-BD2F-4008-9AC2-0F816C09F4EE}\LanguageProfile]

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\CTF\TIP\{F89E9E58-BD2F-4008-9AC2-0F816C09F4EE}\LanguageProfile\0x00000009]

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\CTF\TIP\{F89E9E58-BD2F-4008-9AC2-0F816C09F4EE}\LanguageProfile\0x00000009\{0965500C-82F3-49C2-9F00-01C2FEACAA0B}]
"Description"="On-Screen Standard Keyboard"
"IconFile"="C:\\WINDOWS\\ime\\softkbd.dll"
"IconIndex"=dword:00000000
"Display Description"="@C:\\WINDOWS\\ime\\softkbd.dll,-400"

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\CTF\TIP\{F89E9E58-BD2F-4008-9AC2-0F816C09F4EE}\LanguageProfile\0x00000009\{B2A54871-05F6-4BFC-B97D-0FDF0CBFA57D}]
"Description"="On-Screen Symbol Keyboard"
"IconFile"="C:\\WINDOWS\\ime\\softkbd.dll"
"IconIndex"=dword:00000001
"Display Description"="@C:\\WINDOWS\\ime\\softkbd.dll,-401"

the whole nine yard is here. even office 2003 leaves some weird registry entry for handwriting stuff, so just remove this key and it wont be available. I mean, the handwriting and softkeyboard wont show up in langbar (ctfmon) when you dont want them.
CodeGuru: ComboBox with Item Tooltips

another MFC example about tooltip on combobox, anyting for WTL?

The only REAL guide to playing back Mobile YouTube videos | Smartphone & Pocket PC magazine

The only REAL guide to playing back Mobile YouTube videos | Smartphone & Pocket PC magazine

at least one way to get back the ability to play m.youtube.com video directly.

星期二, 八月 05, 2008

Control.KeyPress Event (System.Windows.Forms): "The KeyPress event is not raised by noncharacter keys; however, the noncharacter keys do raise the KeyDown and KeyUp events."

I guess this goes back to the typist era, 'backspace' is a character key while del/<-/-> are not.
Tiptoe Through the ToolTips, MSJ April 1997
another MFC tooltip example, not as nice as neattooltip from codeproject

Five tips for enjoying 98 Pounds' Chinese/sushi buffet, page 1 - Restaurants - City Pages

Five tips for enjoying 98 Pounds' Chinese/sushi buffet, page 1 - Restaurants - City Pages

this is no tip, if this guy doesnt like buffet in general, just dont go eat buffet.
CComboBox::SetDroppedWidth (MFC)
WTL doesn't work exact the same but similar

CDC dc = cCombo1.GetDC();
HFONT font = cCombo1.GetFont();
HFONT oldfont = dc.SelectFont(font);
SIZE size;
...
if (dc.GetTextExtent(pds->MapName, -1, &size)){
if (size.cx > maxWidth) maxWidth = size.cx;
}
...
dc.SelectFont(oldfont);