WIN32_FIND_DATAW, FindFirstFileW and so on

Everything else that doesn't fall into one of the other PB categories.
GenRabbit
Enthusiast
Enthusiast
Posts: 118
Joined: Wed Dec 31, 2014 5:41 pm

WIN32_FIND_DATAW, FindFirstFileW and so on

Post by GenRabbit »

Hi
I'm testing something where I need access to these "WinAPI" FindFirstFileW , FindNextFileNameW, FindFirstFileW and some other? can they be added myself and if so how? And the structure WIN32_FIND_DATAW(which I presume is identical to WIN32_FIND_DATA, except for use of unicode chars for filenames.
fryquez
Enthusiast
Enthusiast
Posts: 362
Joined: Mon Dec 21, 2015 8:12 pm

Re: WIN32_FIND_DATAW, FindFirstFileW and so on

Post by fryquez »

If you compile as unicode, PB will automaticly use the "W" Api versions.

Code: Select all

Define hSearch, WinFind.WIN32_FIND_DATA

hSearch = FindFirstFile_("*", @WinFind)
If hSearch <> #INVALID_HANDLE_VALUE
  Repeat
    Debug PeekS(@WinFind\cFileName[0])
  Until FindNextFile_(hSearch, @WinFind) = #False
  FindClose_(hSearch)
EndIf 
GenRabbit
Enthusiast
Enthusiast
Posts: 118
Joined: Wed Dec 31, 2014 5:41 pm

Re: WIN32_FIND_DATAW, FindFirstFileW and so on

Post by GenRabbit »

Ah, oki.. Thanks for that info.
Post Reply