Re: Win32Lib not showing WS_EX_WINDOWEDGE

new topic     » goto parent     » topic index » view thread      » older message » newer message

Hi EuMan,
     Thanx a lot for the code. It works great!. Is there a way to detect the
difference btn XP & .Net Servers?. Anyway, the code looks and works great.
Thanx for the contibution.

Jordah
----- Original Message -----
From: <euman at bellsouth.net>
To: "EUforum" <EUforum at topica.com>
Subject: Re: Win32Lib not showing WS_EX_WINDOWEDGE



Jordah writes:
> Hi EuMan,
>      Unfortunately, i'm back to win98 on my new laptop. Bythe time i used
to
> code in xp, i used to use 4.0 and received desired results without a
> manifest. Its kinda funny, all control classes in user32.dll in XP use
> themes by default(window,button).
>       Maybe, it would be a good idea to post your manifest file and the
two
> examples showing this for other users to check. AFAIK, 3.1/4.0
applications
> made in other languages work great with XP.
>       BTW, Just to save me time. Could u paste the code snippets for
> detecting which OS u use. i think this will be ideal for euwin win32GUI
> library.

Hey Jordah,

And I thought you werent coding Win32lib anymore :)

I will need to construct a "small demo" showing the issue
with the button controls I mentioned earlier but for your
request, here is (not sure this is my latest edition) to
collect information about .dll versions and the O/S they
run on.

In fact Im sure this isnt the latest issue, I'll hunt for it.
This doesnt detect the (sp) updates for 2K, XP etc.

Should give you an idea that its pretty straight forward
and easy besides, knowing you, you'll pick thru it and
update what I have here anyway.\

I have my own memory handling routines (found in my installer)
"EuSup" so the below code could need an occasional mem_set
I very quickly renamed myalloc/myfree back to allocate/free

I'll make a complete module including the define_c_func's, const. etc
in a day or so and submit a "clean" user ready module for .dll and O/S
version detection to RDS.

Here's what I have for now, Good luck!

-- Copyright 2002 Euman -> HW. Overman

global function allocate_string2(sequence s)
atom mem
    mem = allocate(length(s) + 1)
    poke(mem, s)
    return mem
end function

function GetFileVersionInfoSize(sequence FileName)
atom pZero, pStr
integer size
  pZero = allocate(16)
  pStr = allocate_string2(FileName)
  size = c_func(xGetFileVersionInfoSize,{pStr,pZero})
  free(pStr)
  free(pZero)
return size
end function

function GetFileVersionInfo(sequence FileName)
atom pInfo, pStr, success
integer size
sequence info
   size = GetFileVersionInfoSize(FileName)
   if not size then return -1 end if
   pStr = allocate_string2(FileName)
   pInfo = allocate(size)
   success = c_func(xGetFileVersionInfo,{pStr,0,size,pInfo})
   free(pStr)
   if not success then
     free(pInfo)
     return -1
   end if
   info = peek({pInfo,size})
   free(pInfo)
return info
end function

function VerQueryValue(sequence info, sequence ValueName)
atom  pInfo, pValueName, ppValue, pLen, index, dat1, dat2, dat3, dat4
integer bool, size

  size = length(info)+1
  pInfo = allocate(size)
  poke(pInfo, info)
  pValueName = allocate_string2(ValueName)
  ppValue = allocate(16)
  pLen = allocate(16)
  bool = c_func(xVerQueryValue,{pInfo, pValueName,ppValue,pLen})
  free(pInfo)
  free(pValueName)
  if not bool then
    free(ppValue)
    free(pLen)
    return -1
  end if
  index=peek4u(ppValue)
  dat1=HIWORD(peek4u(index+8))
  dat2=LOWORD(peek4u(index+8))
  dat3=HIWORD(peek4u(index+12))
  dat4=LOWORD(peek4u(index+12))
  free(pLen)
  free(ppValue)
return {dat1,dat2,dat3,dat4} --
--return sprint(dat1,dat2,dat3,dat4)
end function

global function GetVersionStr(sequence FileName)
object info
sequence version
  info = GetFileVersionInfo(FileName)
  if atom(info) then return -1 end if
  version = VerQueryValue(info,"\\")
  return version
end function

global sequence kernel32_inf,
                comctl32_inf,
                user32_inf,
                gdi32_inf,
                lz32_inf,
                advapi32_inf

comctl32_inf = GetVersionStr("comctl32.dll")
--rem'd the others for message size "You get the idea"

atom testver, bad

if comctl32_inf[1] < 4 then
   if comctl32_inf[2] < 69 then
      bad=message_box("Incompatible CommCtl32.dll
Version","Error",MB_ICONERROR)
   end if
   if getc(0) then
      abort(0)
   end if
end if

-- OS Version

atom ptOS, val, major, minor, build, platf
global sequence OS


   ptOS = allocate( 148 )
   poke4(ptOS,148)
   val = c_func(OSVersion, {ptOS})

   major = peek4u(ptOS+4)
   minor = peek4u(ptOS+8)
   build = peek4u(ptOS+12)
   platf = peek4u(ptOS+16)

   if major = 3 then --NT3.51

      OS = "NT 3.51"

   elsif major = 4 then --95,98,ME,NT4

      if minor = 0 then
         if platf = 1 then
            OS = "95"
         elsif platf = 2 then
            OS = "NT 4.0"
         end if

      elsif minor = 10 then
            OS = "98"
      elsif minor = 90 then
            OS = "ME"
      end if

   elsif major = 5 then --2k,XP,.Net Server

      if minor = 0 then
         OS = "2000"
      elsif minor = 1 then
         OS = "XP or .Net Server"
      end if
   end if

   --junk = message_box(sprintf( "Boolean: %d.%d",
{peek4u(ptOS+4),peek4u(ptOS+8)} ),
"OSVersion",MB_ICONINFORMATION+MB_TASKMODAL )
   free(ptOS)


regards
THE EUMAN

----- Original Message -----
From: <jordah at btopenworld.com>
To: "EUforum" <EUforum at topica.com>
Sent: Saturday, March 22, 2003 10:14 AM
Subject: Re: Win32Lib not showing WS_EX_WINDOWEDGE


>

==^^===============================================================
This email was sent to: jordah at btopenworld.com


TOPICA - Start your own email discussion group. FREE!

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu