|
Amen to this.
"In testa che avete, Signor di Ceprano?"
-- Rigoletto
|
|
|
|
|
Message Closed
modified 15-May-23 19:06pm.
|
|
|
|
|
Have you even looked at the documentation for QDebug?
Specifically : Quote: QDebug &QDebug::operator<<(QChar t)
Writes the character, t, to the stream and returns a reference to the stream. Normally, QDebug prints control characters and non-US-ASCII characters as their C escape sequences or their Unicode value (\u1234). To print non-printable characters without transformation, enable the noquote() functionality, but note that some QDebug backends may not be 8-bit clean and may not be able to represent it.
which leads us to:
Quote: QDebug &QDebug::noquote()
Disables automatic insertion of quotation characters around QChar, QString and QByteArray contents and returns a reference to the stream.
When quoting is disabled, these types are printed without quotation characters and without escaping of non-printable characters.
If you need quoted output, its simple enough to do it yourself, just escape the quotes (\") or use Raw literals e.g. std::string hello(R"x("Hello World")x") assigns "Hello World" , *including the quote marks" to the variable hello ,
NB. I have not tried this. I do not use QT. I don't know if this will achieve what you want. I do know how to use google, though. It's more than time enough that you did too.
Keep Calm and Carry On
|
|
|
|
|
Message Closed
modified 15-May-23 19:06pm.
|
|
|
|
|
Member 14968771 wrote: ..RTFM.. everybody knows that..." disease.
What a pity you seem immune to it.
|
|
|
|
|
Hello. I apologize in advance if I created the topic in the wrong place, because I think that my task is directly or indirectly related to WinApi. I will describe the task:
I am programming an imitation of manual work in applications for working on financial markets (Metatrader 4 and 5). I use AutoIt for this. I need to read the text of the SysListView32 items .I wrote the following code for this purpose .
#include <WinAPI.au3>
#include <Memory.au3>
#include <ListViewConstants.au3>
Local $pid= ; here i write id of needed process
Local $hwnd= ; here i write handle of SysListView32
Local $maxtext= ;here i write max number of chars
Local $hprocess=_WinAPI_OpenProcess($PROCESS_ALL_ACCESS,False,$pid)
Local $plv=_MemVirtualAllocEx($hprocess,Null,$maxtext+60,$MEM_COMMIT,$PAGE_READWRITE)
Local $rectext=DllStructCreate("char ["&$maxtext&"]")
Local $lv=DllStructCreate($tagLVITEM)
$lv.Mask=$LVIF_TEXT
$lv.Item=0
$lv.SubItem=0
$lv.Text=$plv+60
$lv.TextMax=$maxtext
_WinAPI_WriteProcessMemory($hprocess,$plv,DllStructGetPtr($lv),60,Null)
_SendMessageA($hwnd,$LVM_GETITEMA,0,$plv)
_WinAPI_ReadProcessMemory($hprocess,$lv.Text,DllStructGetPtr($rectext),$maxtext,Null)
_MemVirtualFreeEx($hprocess,$plv,0,$MEM_RELEASE)
ConsoleWrite(DllStructGetData($rectext,1))
The problem is that the above code only gets text of items if the SysListView32 has either LVS_OWNERDATA or LVS_OWNERDRAWFIXED style. I have checked above code on different applications with SysListView32 that only had style LVS_OWNERDATA and checked above code on different applications with SysListView32 that only had style LVS_OWNERDRAWFIXED. In both cases i was able to get text from SysListView32 items. But above code is not getting text of SysListView32 items with combined LVS_OWNERDATA and LVS_OWNERDRAWFIXED styles . The SysListView32 of Metatrader application have combined styles LVS_OWNERDATA+LVS_OWNERDRAWFIXED.
Well here's the question:
How to get item text from SysListView32 from another application with both LVS_OWNERDATA and LVS_OWNERDRAWFIXED styles at the same time?
I would like to get some direction of action or example code (doesn't matter on AutoIt). Thank you.
|
|
|
|
|
I am not sure that you can get the information. When a view has one of the OWNERDRAW settings it does not have a backing list of items. As the view tries to display its contents it sends a message to the parent Window which tells the application to return the text for each item. So it is the application that holds the actual data, not the ListView.
|
|
|
|
|
And how i can get actual ListView's data from application ?
|
|
|
|
|
|
There is no standard way of doing that. The data backing the owner-draw can be stored any way the application needs. It can be, literally, stored anywhere, in any format, with no public API to get at it.
Think of how you store data in your own applications. Do you expose that data in standardized ways across all of your applications? Do you expose that data in a public API? Of course not!
|
|
|
|
|
How do I change the window caption color ?
|
|
|
|
|
|
|
OK, thank you for the info!
|
|
|
|
|
Kind of an odd spam post though?
|
|
|
|
|
|
How can you insert the elastic walls of the snooker table and make all the 16 balls move and bounce off the walls?
Can someone pliz help me with the code of a functional snooker game using C programing.
|
|
|
|
|
Sorry this site does not provide code to order. To creatre such a program would need a good knowledge of C programming, general GUI processes and (probably) Windows GDI+ or Direct2D. This is not something that you could create in an afternoon.
|
|
|
|
|
|
Francis Lagar wrote: How can you insert th
Steps
1. Learn basic C
2. Learn how to get and use some additional basic libraries for C.
3. Learn basic UI interactions.
4. Draw some basic shapes using 1-3 on your monitor which are sort of like what you want. It will improve later.
5. Learn collision mathematics and how it relates to games. This is not going to be simple. You could skip this and just guess unless you really want it to look right.
6. Create actual program by breaking into parts. For smooth movement you are going to need how to make the graphics move incrementally. This can either be simple (but jerky) or you can spend a lot of time learning it.
I suspect there is going to be more to the above.
|
|
|
|
|
Depending on the environment, basic real-time programming and multithreading may also be required.
Freedom is the freedom to say that two plus two make four. If that is granted, all else follows.
-- 6079 Smith W.
|
|
|
|
|
Message Closed
modified 15-May-23 19:06pm.
|
|
|
|
|
It returns an int . That int is similar to what you would get from open(2) , and can be used in many places any other file descriptor could be - e.g read(2) , write(2) , and, of course, close(2) . I think that some fcntl(2) operations are also valid for socket fds. But you'll probably get a error if you try to use lseek(2) on a socket. If you prefer, its a file descriptor that describes a socket. Just like open("/dev/ttyS0", O_RDWR) returns a file descriptor that describes a serial port and open("data.txt", O_WRONY|O_CREAT, 0660) returns a file descriptor that describes (presumbably) a text file in the CWD, or open("/tmp/mypipe", O_RDONLY) returns a file descriptor that might be a named pipe.
NB: in the notation open(2) the (2) refers to the manual section that describes the system. So for example man 1 stat produces the man page for the stat command, whereas man 2 stat produces the man page for the stat system call.
Keep Calm and Carry On
|
|
|
|
|
Member 14968771 wrote: RTFM is not an answer I am looking for...
Except that it is the answer: socket(2) - Linux manual page[^], explains it in detail.
|
|
|
|
|
Member 14968771 wrote: If it returns "error" - how can I actually read it / get it in human / verbose format ?
Just noting that in my experience what the number means, even if you can map it, is very seldom useful.
In general it can only mean about two things.
1. You passed in an incorrect parameter. But it will tell you nothing about what or why it is wrong.
2. The system is way overloaded. It too will tell you nothing about what is specifically overloaded.
And just to be clear the error here has nothing to do with actually communicating.
|
|
|
|