日本好好热aⅴ|国产99视频精品免费观看|日本成人aV在线|久热香蕉国产在线

  • <cite id="ikgdy"><table id="ikgdy"></table></cite>
    1. 西西軟件園多重安全檢測下載網(wǎng)站、值得信賴的軟件下載站!
      軟件
      軟件
      文章
      搜索

      首頁編程開發(fā)VC|VC++ → 窗口處理控件技巧大全

      窗口處理控件技巧大全

      相關(guān)軟件相關(guān)文章發(fā)表評論 來源:本站整理時間:2010/10/21 15:35:49字體大。A-A+

      作者:佚名點擊:60次評論:0次標(biāo)簽: 窗口處理 控件

      • 類型:音頻處理大。1M語言:中文 評分:5.1
      • 標(biāo)簽:
      立即下載
      一下例子中可能用到的api聲明和常量、變量聲明
      private declare function getwindowlong lib “user32″ alias “getwindowlonga” (byval hwnd as long, byval nindex as long) as long
      private declare function setwindowlong lib “user32″ alias “setwindowlonga” (byval hwnd as long, byval nindex as long, byval dwnewlong as long) as long
      private declare function setwindowpos lib “user32″ (byval hwnd as long, byval hwndinsertafter as long, byval x as long, byval y as long, byval cx as long, byval cy as long, byval wflags as long) as long
      private const swp_nosize = &h1
      private const swp_nozorder = &h4
      private const swp_nomove = &h2
      private const swp_drawframe = &h20
      private const gwl_style = (-16)
      private const ws_thickframe = &h40000
      private const ws_dlgframe = &h400000
      private const ws_popup = &h80000000
      private const ws_caption = &hc00000
      private const ws_sysmenu = &h80000
      private const ws_minimizebox = &h20000
      private const ws_maximizebox = &h10000
      private const ws_minimize = &h20000000
      private const ws_maximize = &h1000000

      ——————————————————————————–

      例子一:任何一個控件(只要有窗口,這是我們的前提,下同),你可以在運行時隨便更改它的大小。 private sub controlsize(controlname as control, settrue as boolean)
      dim dwstyle as long
      dwstyle = getwindowlong(controlname.hwnd, gwl_style)
      if settrue then
      dwstyle = dwstyle or ws_thickframe
      else
      dwstyle = dwstyle – ws_thickframe
      end if
      dwstyle = setwindowlong(controlname.hwnd, gwl_style, dwstyle)
      setwindowpos controlname.hwnd, controlname.parent.hwnd, 0, 0, 0, 0, swp_nozorder or swp_nosize or swp_nomove or swp_drawframe
      end sub
      用法:controlsize picture1,true;設(shè)置第二個參數(shù)為false取消這種設(shè)置,下同

      ——————————————————————————–

      例子二:任何一個控件,我們都可以控制其顯示風(fēng)格為對話框的風(fēng)格。
      private sub controldialog(controlname as control, settrue as boolean)

      dim dwstyle as long
      dwstyle = getwindowlong(controlname.hwnd, gwl_style)
      if settrue then
      dwstyle = dwstyle or ws_dlgframe
      else
      dwstyle = dwstyle – ws_dlgframe
      end if
      dwstyle = setwindowlong(controlname.hwnd, gwl_style, dwstyle)
      setwindowpos controlname.hwnd, controlname.parent.hwnd, 0, 0, 0, 0, swp_nozorder or swp_nosize or swp_nomove or swp_drawframe
      end sub
      用法:controlsize picture1,true

      ——————————————————————————–

      例子三:任何一個控件,我們都可以控制其顯示風(fēng)格為模式對話框的風(fēng)格
      private sub controlmodal(controlname as control, settrue as boolean)
      dim dwstyle as long
      dwstyle = getwindowlong(controlname.hwnd, gwl_style)
      if settrue then
      dwstyle = dwstyle or ws_popup
      else
      dwstyle = dwstyle – ws_popup
      end if
      dwstyle = setwindowlong(controlname.hwnd, gwl_style, dwstyle)
      setwindowpos controlname.hwnd, controlname.parent.hwnd, 0, 0, 0, 0, swp_nozorder or swp_nosize or swp_nomove or swp_drawframe
      end sub
      用法:controlmodal picture1,true

      ——————————————————————————–

      例子四:任何一個控件,我們都可以給它加上標(biāo)題欄,通過拖動標(biāo)題欄,可以實現(xiàn)控件的運行時移動。
      private sub controlcaption(controlname as control, settrue as boolean) dim dwstyle as long
      dwstyle = getwindowlong(controlname.hwnd, gwl_style)
      if settrue then
      dwstyle = dwstyle or ws_caption
      else
      dwstyle = dwstyle – ws_caption
      end if
      dwstyle = setwindowlong(controlname.hwnd, gwl_style, dwstyle)
      setwindowpos controlname.hwnd, controlname.parent.hwnd, 0, 0, 0, 0, swp_nozorder or swp_nosize or swp_nomove or swp_drawframe
      end sub
      用法:controlcaption picture1,true

      ——————————————————————————–

      例子五:任何一個控件,我們都可以給它加上controlbox(所謂controlbox,就是窗體的圖標(biāo)+最小化+最大化+關(guān)閉按鈕)。
      private sub controlsysmenu(controlname as control, settrue as boolean)
      dim dwstyle as long
      dwstyle = getwindowlong(controlname.hwnd, gwl_style)
      if settrue then
      dwstyle = dwstyle or ws_sysmenu
      else
      dwstyle = dwstyle – ws_sysmenu
      end if
      dwstyle = setwindowlong(controlname.hwnd, gwl_style, dwstyle)
      setwindowpos controlname.hwnd, controlname.parent.hwnd, 0, 0, 0, 0, swp_nozorder or swp_nosize or swp_nomove or swp_drawframe
      end sub
      用法:controlcaption picture1,true:controlsysmenu picture1,true

        相關(guān)評論

        閱讀本文后您有什么感想? 已有人給出評價!

        • 8 喜歡喜歡
        • 3 頂
        • 1 難過難過
        • 5 囧
        • 3 圍觀圍觀
        • 2 無聊無聊

        熱門評論

        最新評論

        發(fā)表評論 查看所有評論(0)

        昵稱:
        表情: 高興 可 汗 我不要 害羞 好 下下下 送花 屎 親親
        字數(shù): 0/500 (您的評論需要經(jīng)過審核才能顯示)