要如何控制 TrackBar 的原件呢?
小弟想用自己寫的程式去控制如下的TrackBar 原件
[img=http://social.microsoft.com/Forums/getfile/11939/][/img]
以下是小弟自己先琢磨出來的代碼:
SendMessage(hwnd3, TBM_SETRANGEMIN, True, 0)
SendMessage(hwnd3, TBM_SETRANGEMAX, True, 1607)
' SendMessage(hwnd3, TBM_SETPOS, True, Val(newpos)) '/Set the current slider position
SendMessage(hwnd3, TBM_SETPOS, True, 50)
<00001> 0003138C S WM_PSD_PAGESETUPDLG wPaper:0000 wFlags:0 lppsd:00000000 [wParam:00000000 lParam:00000000]
<00002> 0003138C R WM_PSD_PAGESETUPDLG fPreventDraw:True [lResult:00000074]
<00003> 0003138C S WM_PSD_ENVSTAMPRECT hDC:00000001 lprcEnvStamp:00000075 [wParam:00000001 lParam:00000075]
<00004> 0003138C R WM_PSD_ENVSTAMPRECT fPreventDraw:False [lResult:00000000]
<00005> 0003138C S WM_PSD_PAGESETUPDLG wPaper:0000 wFlags:0 lppsd:00000000 [wParam:00000000 lParam:00000000]
<00006> 0003138C R WM_PSD_PAGESETUPDLG fPreventDraw:True [lResult:00000075]
<00007> 0003138C S WM_PSD_ENVSTAMPRECT hDC:00000001 lprcEnvStamp:00000076 [wParam:00000001 lParam:00000076]
<00008> 0003138C R WM_PSD_ENVSTAMPRECT fPreventDraw:False [lResult:00000000]
<00009> 0003138C S WM_PSD_PAGESETUPDLG wPaper:0000 wFlags:0 lppsd:00000000 [wParam:00000000 lParam:00000000]
<00010> 0003138C R WM_PSD_PAGESETUPDLG fPreventDraw:True [lResult:00000076]
<00011> 0003138C S WM_PSD_ENVSTAMPRECT hDC:00000001 lprcEnvStamp:00000077 [wParam:00000001 lParam:00000077]
<00012> 0003138C R WM_PSD_ENVSTAMPRECT fPreventDraw:False [lResult:00000000]
<00013> 0003138C S WM_PSD_PAGESETUPDLG wPaper:0000 wFlags:0 lppsd:00000000 [wParam:00000000 lParam:00000000]
<00014> 0003138C R WM_PSD_PAGESETUPDLG fPreventDraw:True [lResult:00000077]
<00015> 0003138C S WM_PSD_ENVSTAMPRECT hDC:00000001 lprcEnvStamp:00000078 [wParam:00000001 lParam:00000078]
<00016> 0003138C S WM_PAINT hdc:00000000 [wParam:00000000 lParam:00000000]
<00017> 0003138C S WM_PRINTCLIENT hdc:93013841 uFlags:PRF_CLIENT | PRF_CHILDREN [wParam:93013841 lParam:00000014]
<00018> 0003138C S message:0x2138 [User-defined:WM_USER+7480] wParam:42014179 lParam:0003138C
<00019> 0003138C R message:0x2138 [User-defined:WM_USER+7480] lResult:00000010
<00020> 0003138C S message:0x204E [User-defined:WM_USER+7246] wParam:00000000 lParam:0012E75C
<00021> 0003138C R message:0x204E [User-defined:WM_USER+7246] lResult:00000000
<00022> 0003138C R WM_PRINTCLIENT lResult:00000000
<00023> 0003138C R WM_PAINT lResult:00000000
<00024> 0003138C R WM_PSD_ENVSTAMPRECT fPreventDraw:False [lResult:00000000]
<00025> 0003138C S WM_PSD_PAGESETUPDLG wPaper:0000 wFlags:0 lppsd:00000000 [wParam:00000000 lParam:00000000]
<00026> 0003138C R WM_PSD_PAGESETUPDLG fPreventDraw:True [lResult:00000078]
<00027> 0003138C S WM_PSD_ENVSTAMPRECT hDC:00000001 lprcEnvStamp:00000079 [wParam:00000001 lParam:00000079]
<00028> 0003138C R WM_PSD_ENVSTAMPRECT fPreventDraw:False [lResult:00000000]
<00029> 0003138C S WM_PSD_PAGESETUPDLG wPaper:0000 wFlags:0 lppsd:00000000 [wParam:00000000 lParam:00000000]
<00030> 0003138C R WM_PSD_PAGESETUPDLG fPreventDraw:True [lResult:00000079]
<00031> 0003138C S WM_PSD_ENVSTAMPRECT hDC:00000001 lprcEnvStamp:0000007A [wParam:00000001 lParam:0000007A]
<00032> 0003138C R WM_PSD_ENVSTAMPRECT fPreventDraw:False [lResult:00000000]
<00033> 0003138C S WM_PSD_PAGESETUPDLG wPaper:0000 wFlags:0 lppsd:00000000 [wParam:00000000 lParam:00000000]
<00034> 0003138C R WM_PSD_PAGESETUPDLG fPreventDraw:True [lResult:0000007A]
<00035> 0003138C S WM_PSD_ENVSTAMPRECT hDC:00000001 lprcEnvStamp:0000007B [wParam:00000001 lParam:0000007B]
<00036> 0003138C R WM_PSD_ENVSTAMPRECT fPreventDraw:False [lResult:00000000]
<00037> 0003138C S WM_PSD_PAGESETUPDLG wPaper:0000 wFlags:0 lppsd:00000000 [wParam:00000000 lParam:00000000]
<00038> 0003138C R WM_PSD_PAGESETUPDLG fPreventDraw:True [lResult:0000007B]
<00039> 0003138C S WM_PSD_ENVSTAMPRECT hDC:00000001 lprcEnvStamp:0000007C [wParam:00000001 lParam:0000007C]
<00040> 0003138C R WM_PSD_ENVSTAMPRECT fPreventDraw:False [lResult:00000000]
<00041> 0003138C S WM_PSD_PAGESETUPDLG wPaper:0000 wFlags:0 lppsd:00000000 [wParam:00000000 lParam:00000000]
<00042> 0003138C R WM_PSD_PAGESETUPDLG fPreventDraw:True [lResult:0000007C]
<00043> 0003138C S WM_PSD_ENVSTAMPRECT hDC:00000001 lprcEnvStamp:0000007D [wParam:00000001 lParam:0000007D]
<00044> 0003138C R WM_PSD_ENVSTAMPRECT fPreventDraw:False [lResult:00000000]
<00045> 0003138C S WM_PSD_PAGESETUPDLG wPaper:0000 wFlags:0 lppsd:00000000 [wParam:00000000 lParam:00000000]
<00046> 0003138C R WM_PSD_PAGESETUPDLG fPreventDraw:True [lResult:0000007D]
<00047> 0003138C S WM_PSD_ENVSTAMPRECT hDC:00000001 lprcEnvStamp:0000007E [wParam:00000001 lParam:0000007E]
<00048> 0003138C S WM_PAINT hdc:00000000 [wParam:00000000 lParam:00000000]
<00049> 0003138C S WM_PRINTCLIENT hdc:C5014011 uFlags:PRF_CLIENT | PRF_CHILDREN [wParam:C5014011 lParam:00000014]
<00050> 0003138C S message:0x2138 [User-defined:WM_USER+7480] wParam:560141A6 lParam:0003138C
<00051> 0003138C R message:0x2138 [User-defined:WM_USER+7480] lResult:00000010
<00052> 0003138C S message:0x204E [User-defined:WM_USER+7246] wParam:00000000 lParam:0012E75C
<00053> 0003138C R message:0x204E [User-defined:WM_USER+7246] lResult:00000000
<00054> 0003138C R WM_PRINTCLIENT lResult:00000000
<00055> 0003138C R WM_PAINT lResult:00000000
[解决办法]
有誰能幫我解決這個問題嗎? 小弟急用阿 帖子不要沉了..
[解决办法]
我試著直接用postmessage 在不播放的情況下去移動滑軌
PostMessage(hwnd3, TBM_SETPOS, True, 1500)
這樣子滑軌原本在初始狀態的位置 會跑到中間來 可是按下播放按鍵播放時
滑軌又跑回原來的位置 是不是不能這樣控制滑軌呢?
有沒有人有控制播放器滑軌經驗的 提供一下線索吧!