在VB6,VS2003的程式加XP面板

2021-04-13 13:29:07 字數 2234 閱讀 5229

在vb6,vs2003的程式加xp**。

一、新增以下部分為模組檔案

option explicit

private declare function getversionex lib "kernel32" alias "getversionexa" (lpversioninformation as osversioninfo) as long

private declare function shellexecute& lib "shell32.dll" alias "shellexecutea" (byval hwnd as long, byval lpoperation as string, byval lpfile as string, byval lpparameters as string, byval lpdirectory as string, byval nshowcmd as long)

private declare function initcommoncontrol*** lib "comctl32.dll" (lpinitctrls as initcommoncontrol***_type) as long

private const icc_internet_classes = &h800

private const ver_platform_win32s = 0

private const ver_platform_win32_windows = 1

private const ver_platform_win32_nt = 2

private enum startwindowstate

start_hidden = 0

start_normal = 4

start_minimized = 2

start_maximized = 3

end enum

private type osversioninfo

osvsize as long

dwvermajor as long

dwverminor as long

dwbuildnumber as long

platformid as long

szcsdversion as string * 128

end type

private const winxp = 6

private type initcommoncontrol***_type

dwsize as long

dwicc as long

end type

private function shelldocument(sdocname as string, _

optional byval action as string = "open", _

optional byval parameters as string = vbnullstring, _

optional byval directory as string = vbnullstring, _

optional byval windowstate as startwindowstate) as boolean

dim response

response = shellexecute(&o0, action, sdocname, parameters, directory, windowstate)

select case response

case is < 33

shelldocument = false

case else

shelldocument = true

end select

end function

private function win32ver() as long

dim oosv as osversioninfo

oosv.osvsize = len(oosv)

if getversionex(oosv) = 1 then

if (oosv.platformid = ver_platform_win32_nt and oosv.dwvermajor = 5 and oosv.dwverminor = 1) then

win32ver = winxp

end if

end if

end function

這樣就會自動識別xp的**,在vb6中要用5。0的控制項庫,盡量不要用frame,

否則他裡面的控制項會跳動重新整理,不好看。

VB 讓外部程式在VB程式的窗體裡面執行

option explicit private declare function findwindow lib user32 alias findwindowa byval lpclassname as long,byval lpwindowname as long as long private ...

VB6程式與Windows Vista的相容問題

windows vista開始逐漸進入市場,微軟對 indows xp的支援大限已經日時不多,ista的流行是勢在必然 雖著企業使用者作業系統的公升級,以前開發的visual studio basic 6程式與vista的相容性問題漸漸浮出水面 微軟在官方 上發布了windows vista 上的 ...

VC6 VS2003編譯器優化造成的bug

昨天在csdn上面看到這樣一貼,居然爆料vc6 vs2003有乙個嚴重的bug,於是自己也仔細研究一番 2 出錯 3 原因分析 當我在使用ide環境選擇release生成後,確實發現有上述問題 於是我修改他的 狼兄弟建議我先看看此時i的十進位制數值與十六進製制數值 在命令列編譯引數中新增 fa即可得...