小编Alp*_*pay的帖子

以编程方式设置标题栏和边框颜色

我试图以编程方式更改我的应用程序的标题栏和边框颜色.我尝试了很多东西,但没有成功,并决定在整个系统中更改这些颜色.因为我可以在应用程序运行时更改标题栏和边框颜色,并在应用程序结束时将其还原.(托管环境,运行少量应用程序)

是否可以动态更改这些颜色(在整个过程范围内,或在系统范围内更改,除非可以进行整个过程的更改)?你能建议任何方法来达到这个目的吗?

我尝试了类似下面的东西,但它没有做我想要的:

int aElements[2] = {COLOR_WINDOW, COLOR_ACTIVECAPTION};
DWORD aOldColors[2];
DWORD aNewColors[2];

aOldColors[0] = GetSysColor(aElements[0]); 
aOldColors[1] = GetSysColor(aElements[1]); 
aNewColors[0] = RGB(0x80, 0x80, 0x80);  // light gray 
aNewColors[1] = RGB(0x80, 0x00, 0x80);  // dark purple 

SetSysColors(2, aElements, aNewColors);
SetSysColors(2, aElements, aOldColors);
Run Code Online (Sandbox Code Playgroud)

提前致谢

编辑

这正是我想要的:

在此输入图像描述

c++ windows hook winapi

23
推荐指数
1
解决办法
1万
查看次数

在Windows 8 Pro Tablet中使用WinAPI引发AccessViolationException

我正在尝试使用Magnification API32位Windows 8 Pro平板电脑编写辅助功能应用程序.应用程序可以完美地放大和缩小全屏,但是当放大时,点击事件会被发送到未放大屏幕的错误位置,因此用户无法触摸他所看到的内容.

为了解决这个问题,我试过了MagSetInputTransform(fSetInputTransform, rcSource, rcDest).它适用于64位Windows 8桌面,但当我在平板电脑上测试时,我收到以下错误:

System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
   at GTZoom.WinAPIMethods.MagSetInputTransform(Boolean fEnabled, RECT prcSource, RECT prcDest)
   at GTZoom.ZoomControl.SetInput(IntPtr hwndDlg, Boolean fSetInputTransform) in c:\Users\AlpayK\Desktop\GTMagnify\GTMagnify\ZoomControl.cs:line 113
   at GTZoom.ZoomControl.trackBar1_Scroll(Object sender, EventArgs e) in c:\Users\AlpayK\Desktop\GTMagnify\GTMagnify\ZoomControl.cs:line 37
   at System.Windows.Forms.TrackBar.OnScroll(EventArgs e)
   at System.Windows.Forms.TrackBar.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
Run Code Online (Sandbox Code Playgroud)

当我尝试为x86目标平台编译项目并在64位机器下测试时,获得了完全相同的错误.

总结一下; …

c# winapi winforms magnification-api windows-8

10
推荐指数
1
解决办法
625
查看次数

在 Java 中评估 SQL 表达式?

在我们的项目中,我们需要在没有任何数据库服务器的情况下评估 SQL 语句。您能否推荐任何能够评估基于数学的 SQL 语句并返回结果的免费 Java 库?

例如;

输入

SELECT 2*2 AS RESULT

输出

4

可能会被称为int result = SQLEvaluator.evaluate("SELECT 2*2 AS RESULT");

java sql

5
推荐指数
1
解决办法
3810
查看次数

使用jPcap在Java中实时进行TCP会话重建

我正在侦听特定的网卡并使用jPcap库捕获TCP(仅TCP)数据包.但是,我需要拥有整个TCP会话,而不是单个数据包.

在Wireshark中,我可以选择"关注tcp流",这样我就可以从头到尾完成整个对话.我想在Java中做到这一点.如何实时重建这些数据包?我想在侦听网卡和捕获新数据包的同时重建TCP会话.我怎样才能做到这一点?这是我捕获数据包的代码:

jpcap.NetworkInterface[] devices = JpcapCaptor.getDeviceList();
            JpcapCaptor captor = JpcapCaptor.openDevice(devices[1], 65535, true, 1000);
            JpcapWriter writer = JpcapWriter.openDumpFile(captor, "myNetworkDump");
            captor.loopPacket(-1, new PacketPrinter(writer));
Run Code Online (Sandbox Code Playgroud)
class PacketPrinter implements PacketReceiver {

    private HashMap<Long, ArrayList<Packet>> sessions;
    private BufferedWriter out;
    private JpcapWriter writer;

    Map<Long, TCPBodyData> bodies = new HashMap<Long, TCPBodyData>();

    public PacketPrinter(JpcapWriter writer) {
        this.writer = writer;
        this.sessions = new HashMap<Long, ArrayList<Packet>>();
    }

    public void receivePacket(Packet packet) {
        System.out.println(packet);
        if (packet instanceof TCPPacket) {
            TCPPacket tcppacl = (TCPPacket) packet;
            byte[] body = addBodyData(tcppacl);
            // System.out.println(new String(body));
        } …
Run Code Online (Sandbox Code Playgroud)

java networking tcp jpcap

5
推荐指数
1
解决办法
1198
查看次数

.net核心消息队列解决方案

如我所见,.net核心不支持MSMQ,因为它不是跨平台的(仅Windows)。那么,Microsoft在.net core中针对MQ中间件的解决方案是什么?如果没有,是否建议使用第三方MQ解决方案,例如zeromq,IBM Websphere MQ,Rabbit MQ等?

architecture windows cross-platform message-queue .net-core

5
推荐指数
1
解决办法
1934
查看次数

Java和Android Obfuscator工具建议

我们开发Android和Java项目,我们需要一个具有加密功能的混淆器工具.价格不是问题.你有什么建议我的?什么是可用于Java和Android项目的最佳混淆器

java obfuscation android

4
推荐指数
1
解决办法
1万
查看次数

Kafka 在 kubernetes 上使用 sasl.jaas.config 配置 jaas

我正在使用这个舵图:https : //github.com/helm/charts/tree/master/incubator/kafka

以及 values.yaml 中的这些覆盖

configurationOverrides:
  advertised.listeners: |-
    EXTERNAL://kafka-${KAFKA_BROKER_ID}.host-removed:$((31090 + ${KAFKA_BROKER_ID}))
  listener.security.protocol.map: |-
    PLAINTEXT:SASL_PLAINTEXT,EXTERNAL:SASL_PLAINTEXT
  sasl.enabled.mechanisms: SCRAM-SHA-256
  auto.create.topics.enable: false
  inter.broker.listener.name: PLAINTEXT
  sasl.mechanism.inter.broker.protocol: SCRAM-SHA-256
  listener.name.EXTERNAL.scram-sha-256.sasl.jaas.config: org.apache.kafka.common.security.scram.ScramLoginModule required username="user" password="password";
Run Code Online (Sandbox Code Playgroud)

基于此文档:https : //kafka.apache.org/documentation/#security_jaas_broker

(快速总结)

Brokers may also configure JAAS using the broker configuration property sasl.jaas.config. The property name must be prefixed with the listener prefix including the SASL mechanism, i.e. listener.name.{listenerName}.{saslMechanism}.sasl.jaas.config. Only one login module may be specified in the config value. If multiple mechanisms are configured on a listener, …
Run Code Online (Sandbox Code Playgroud)

apache-kafka kubernetes kubernetes-helm

4
推荐指数
1
解决办法
3820
查看次数