Page 1 of 1

API Question

Posted: Sun May 06, 2018 4:25 am
by Xbase
hi,

i like to ask if this section is for Windows <-> ReactOS API Question :?:

does ReactOS support
// SHELL32.DLL
SHGetFileInfoA()

//User32.DLL
LoadImageA()
CopyIcon()

// COMCTL32.DLL
ImageList_Create()
ImageList_ReplaceIcon()
ImageList_Destroy()
i want to get Icon using SHGetFileInfoA() but my Xbase++ App fail on ReactOS :o

Code: Select all

// Xbase++ Code 
FUNCTION fileIconIndex( cFile, cAttr )
LOCAL nMax   := 352
LOCAL buffer := Replicate( Chr(0), 352 )
LOCAL nAttr  := 0
LOCAL nFlags := bOr(SHGFI_SHELLICONSIZE,SHGFI_SYSICONINDEX,SHGFI_SMALLICON)
LOCAL result

   IF !EMPTY(cAttr)
      nFlags := bOr(nFlags,SHGFI_USEFILEATTRIBUTES)
      IF "D" $ cAttr
         nAttr := FILE_ATTRIBUTE_DIRECTORY   // 0x10
      ELSE
         nAttr := FILE_ATTRIBUTE_NORMAL      // 0x80
      ENDIF
   ENDIF

   result := SHGetFileInfoA(cFile   ,;
                            nAttr   ,;
                            @buffer ,;
                            nMax    ,;
                            nFlags   )
   IF EMPTY(result)
      RETURN 0
   ENDIF

RETURN ( Left(buffer,4) )
more Question
what about Keyboard API Function

Code: Select all

GetKeyboardLayoutList()
GetKeyboardLayout()
ActivateKeyboardLayout()
i use multi Language so i ask for IME Support in ReactOS :?:
(have seen Japanese IME http://katahiromz.web.fc2.com/mzimeja/en/index.html but need Chinese )

Re: API Question

Posted: Sun May 06, 2018 12:46 pm
by ThFabba
To find whether a function is present or missing, and to have a look at its code to estimate how complete it might be, you can simply grep the source code repository, e.g. https://git.reactos.org/?p=reactos.git& ... tFileInfoA

The functions you list all seem to be implemented at least at a basic level, so to find what's going wrong, someone (e.g. you) would have to debug the issue, e.g. by seeing how whether any failures happen or in what ways the code behaves differently from Windows in your specific scenario.
Keyboard layouts in general should work okay, but IME support is basically nonexistent. Feel free to work on it.

Re: API Question

Posted: Mon May 07, 2018 12:31 am
by Xbase
hi,
thx for answer
ThFabba wrote:To find whether a function is present or missing, and to have a look at its code to estimate how complete it might be, you can simply grep the source code repository, e.g. https://git.reactos.org/?p=reactos.git& ... tFileInfoA
OK i will have a look at it

Question : is there a Way to search in Repository ?
ThFabba wrote:Keyboard layouts in general should work okay, but IME support is basically nonexistent. Feel free to work on it.
OK, i have to search for some old NT Stuff where i had some 3PP chinese IME that i can try with ReactOS.

Question : does all ReactOS Controls support Unicode ("W") ... my native Controls are still on Ansi ("A")

Re: API Question

Posted: Mon May 07, 2018 7:50 am
by ThFabba
Xbase wrote:Question : is there a Way to search in Repository ?
Yes, that's what I linked you to. You go to https://git.reactos.org/, pick reactos.git, and there's a search field in the top right (select grep to search text files).
GitHub also has a search feature (at the very top of the page), but it doesn't work as well.

Xbase wrote:Question : does all ReactOS Controls support Unicode ("W") ... my native Controls are still on Ansi ("A")
Yes. Almost every function in ROS/Wine is implemented natively as unicode, and the -A version just converts strings, then calls the -W version.

Re: API Question

Posted: Tue May 08, 2018 3:30 am
by Xbase
ThFabba wrote:Yes, that's what I linked you to. You go to https://git.reactos.org/, pick reactos.git, and there's a search field in the top right (select grep to search text files).
GitHub also has a search feature (at the very top of the page), but it doesn't work as well.
ok now i get more ... but this are only Report IF someone have fix something.

when search for

Code: Select all

Imagelist_
i found Imagelist_Create() but not Imagelist_Destroy() :?:

must i become Member of http://jira.reactos.org (have ask how ?) to search in Source Code Repository :?:

Re: API Question

Posted: Tue May 08, 2018 4:16 am
by Xbase
seem i found it
https://doxygen.reactos.org/
there i can search in Source :D

Re: API Question

Posted: Tue May 08, 2018 4:36 am
by Xbase
ThFabba wrote:Yes. Almost every function in ROS/Wine is implemented natively as unicode, and the -A version just converts strings, then calls the -W version.
what about without "A" or "W" :roll:

i use LVBKIMAGE as Watermark in Listview but fail on ReactOS :o

now i saw in ReactOS commctrl.h
https://doxygen.reactos.org/d8/df7/psdk ... ource.html

Code: Select all

 typedef struct tagLVBKIMAGEA {
 typedef struct tagLVBKIMAGEW {
but as i have not used "A" or "W" it now fail on ReactOS but work that Way on Windows XP - W10 :(

while both Structure are same ... what about some translation LVBKIMAGE -> LVBKIMAGE +"A" or +"W" :idea:

---

who to ask to get Account at http://jira.reactos.org/ :?:

Re: API Question

Posted: Tue May 08, 2018 8:21 am
by oldman
Xbase wrote:who to ask to get Account at http://jira.reactos.org/ :?:
You just use your Forum user name and password. It is also the same user name and password for the wiki.

Re: API Question

Posted: Tue May 08, 2018 9:06 am
by ThFabba
Xbase wrote:ok now i get more ... but this are only Report IF someone have fix something.
I think maybe you didn't select "grep"?
Xbase wrote:
ThFabba wrote:Yes. Almost every function in ROS/Wine is implemented natively as unicode, and the -A version just converts strings, then calls the -W version.
what about without "A" or "W" :roll:

i use LVBKIMAGE as Watermark in Listview but fail on ReactOS :o

now i saw in ReactOS commctrl.h
https://doxygen.reactos.org/d8/df7/psdk ... ource.html

Code: Select all

 typedef struct tagLVBKIMAGEA {
 typedef struct tagLVBKIMAGEW {
but as i have not used "A" or "W" it now fail on ReactOS but work that Way on Windows XP - W10 :(

while both Structure are same ... what about some translation LVBKIMAGE -> LVBKIMAGE +"A" or +"W" :idea:
There's no such thing as an LVBKIMAGE structure. LVBKIMAGE is a macro that is defined as LVBKIMAGEW if your program defines UNICODE, and LVBKIMAGEA otherwise.

The fact that all you find when searching for LVBKIMAGE is the structure definition in the header file indicates that this structure isn't used anywhere in code, i.e. that code path is likely not implemented.
If you search for the message instead of the structure, you get confirmation of this -- it's only found in the header file where it's defined, and in some tests. The implementation in comctl32 is missing (there's a "case LVM_SETBKIMAGE" comment). This code is from Wine, so they'll have the same issue.

Re: API Question

Posted: Tue May 08, 2018 10:21 pm
by Xbase
ThFabba wrote: There's no such thing as an LVBKIMAGE structure.
LVBKIMAGE is a macro that is defined as LVBKIMAGEW if your program defines UNICODE, and LVBKIMAGEA otherwise.
hm ...
MS LVBKIMAGE structure can found here
https://msdn.microsoft.com/en-us/librar ... s.85).aspx

ReactOS Desktop can have a Wallpaper, right :?:
Desktop is Listview in Icon Mode, right :?:

so i wonder how ReactOS can do it when not using Structure (not macro) LVBKIMAGE :roll:

---

other was about is MISSING #define in ReactOS commctrl.h

Code: Select all

#ifdef UNICODE
#define LVBKIMAGE               LVBKIMAGEW
#define LPLVBKIMAGE             LPLVBKIMAGEW
#define LVM_SETBKIMAGE          LVM_SETBKIMAGEW
#define LVM_GETBKIMAGE          LVM_GETBKIMAGEW
#else
#define LVBKIMAGE               LVBKIMAGEA
#define LPLVBKIMAGE             LPLVBKIMAGEA
#define LVM_SETBKIMAGE          LVM_SETBKIMAGEA
#define LVM_GETBKIMAGE          LVM_GETBKIMAGEA
#endif
---

you talk about comctl32 so i have to search in Listview.c what is missing
and look into shlview.c where i found subclass_listview(hwnd_view) and Constante LVM_SETBKIMAGE
( macro lv_SetBkImage() ) to figure out how Wallpaper work under ReactOS / Listview

thx for help

Re: API Question

Posted: Wed May 09, 2018 8:07 am
by ThFabba
At the bottom of that MSDN page you will see:
Unicode and ANSI names: LVBKIMAGEW (Unicode) and LVBKIMAGEA (ANSI)
MSDN generally shows functions and structures without the -A/-W, and then has this note at the bottom.
Independent of that, MSDN is not code, it can be wrong. You have to look at Microsoft's header files for authoritative information.

The shlview.c you see is under modules/rostests, which means it's a test.
ROS is not missing any definitions, the structure is defined as:

Code: Select all

#define LVBKIMAGE __MINGW_NAME_AW(LVBKIMAGE)
... which takes care of the -A/-W via a generic macro.

The desktop listview doesn't use a background image, it is transparent and win32k prints the actual desktop (which is why the wallpaper is there even when explorer is not running).

Re: API Question

Posted: Sat May 12, 2018 10:56 pm
by Xbase
have found "C:\ReactOS\Web\Wallpaper" which ist like NT "C:\Windows\web\wallpaper\Windows\"
since Vista it use %AppData% so i search in wrong Directory for Wallpaper TranscodedWallpaper.jpg

have try using LVM_SETBKIMAGE

Code: Select all

   hListview := @user32:FindWindowExA(hShell,0,"SysListView32"+Chr(0),"FolderView"+Chr(0))
   nRet := @USER32:SendMessageA(hListview, LVM_SETBKIMAGE, 0, ::oLogo )
but you are right it does not contain any Image :(

Re: API Question

Posted: Sun May 13, 2018 9:05 am
by ThFabba
Okay. What's your point?
I thought we already established that LVM_SETBKIMAGE is unimplemented in ROS, so it won't work (in a test, in your application, or elsewhere).
So you have two options:
  • Accept that this background image/watermark feature won't work and continue your testing
  • Implement LVM_SETBKIMAGE. This should happen on the Wine side, but we're happy to help with submissions to them. The first step would be to add a test to comctl32_winetest.

Re: API Question

Posted: Sun May 13, 2018 6:33 pm
by Xbase
ThFabba wrote:Okay. What's your point?
hm ... what do you expect from User when writing in this Forum :?:

other Forum life from Experience of other User which write what they have done.
so i have made a test and just wrote what i have done and what find out.
ThFabba wrote:The first step would be to add a test to comctl32_winetest.
i do not want to be a ROS Developer while i'm not a C Programmer.
i just test my own native Controls with Xbase++ under ROS

so when LVM_SETBKIMAGE is add to comctl32_winetest i'm willing to test it again