byte b = 130; //结果为-126 为什么啊?

本文详细介绍了如何将十进制数130转换为二进制形式,并进一步解释了该二进制数在计算机内部作为int类型的表现形式。包括如何进行符号位判断以及如何从补码还原出原始的十进制数值。
数据130默认是int类型的十进制数据
第一步十进制的130转换成二进制数据
1 0 0 0 0 0 1 0
第二步130是int类型是占4个字节的,所以在内存的表现形式是
00000000  00000000  00000000  10000010
做了截取后的结果为
10000010
通过观察最高位符号位是1,这是一个负数,因为在计算机中所有的数据都是以补码的形式出现的所以要算它的补码
原码:1 0000010    原码变反码,最高位符号位不变,其他数值位1变0,0变1得反码
反码:1 1111101    反码变补码就是反码加1得
补码;1 1111110
最终的看到的结果就是
1     1111110最高为是符号位不运算,数值为转化为十进制是64+32+16+8+4+2=126符号位负
所以为-126
root@VM-20-12-ubuntu:/srs-6.0-d2/trunk# ./objs/srs -c conf/rtmp_srt.conf [2025-07-17 14:16:50.852][INFO][429193][7e9jv004] XCORE-SRS/6.0.85(Hang) [2025-07-17 14:16:50.852][INFO][429193][7e9jv004] config parse complete [2025-07-17 14:16:50.852][INFO][429193][7e9jv004] write log to console [2025-07-17 14:16:50.852][INFO][429193][7e9jv004] SRS/6.0.85(Hang), MIT [2025-07-17 14:16:50.852][INFO][429193][7e9jv004] authors: Winlin<winlin@vip.126.com> ZhaoWenjie<zhaowenjie@tal.com> ShiWei<shiwei05@kuaishou.com> XiaoZhihong<hondaxiao@tencent.com> WuPengqiang<pengqiang.wpq@alibaba-inc.com> XiaLixin<xialixin@kanzhun.com> LiPeng<mozhan.lp@alibaba-inc.com> ChenGuanghua<jinxue.cgh@alibaba-inc.com> ChenHaibo<nmgchenhaibo@foxmail.com> ZhangJunqin<chundonglinlin@126.com> and https://github.com/ossrs/srs/blob/develop/trunk/AUTHORS.md#contributors [2025-07-17 14:16:50.852][INFO][429193][7e9jv004] cwd=/srs-6.0-d2/trunk, work_dir=./, build: 2025-07-17 12:18:20, configure: , uname: Linux VM-20-12-ubuntu 5.4.0-192-generic #212-Ubuntu SMP Fri Jul 5 09:47:39 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux, osx: 0, env: 0, pkg: [2025-07-17 14:16:50.852][INFO][429193][7e9jv004] configure detail: --prefix=/usr/local/srs --config=conf/srs.conf --osx=off --hls=on --hds=off --dvr=on --ssl=on --https=on --ssl-1-0=off --ssl-local=off --sys-ssl=off --transcode=on --ingest=on --stat=on --http-callback=on --http-server=on --stream-converter=on --http-api=on --utest=off --srt=on --rtc=on --h265=off --gb28181=off --simulator=off --cxx11=on --cxx14=off --backtrace=on --ffmpeg-fit=on --ffmpeg-opus=off --nasm=on --srtp-nasm=on --clean=on --gperf=off --gmc=off --gmd=off --gmp=off --gcp=off --gprof=off --static=off --shared-st=off --shared-srt=off --shared-ffmpeg=off --log-verbose=off --log-info=off --log-trace=on --log-level_v2=on --gcov=off --apm=off --debug=off --debug-stats=off --cross-build=off --sanitizer=on --sanitizer-static=off --sanitizer-log=off --cygwin64=off --single-thread=off --generic-linux=off --cc=gcc --cxx=g++ --ar=ar --ld=ld --randlib=randlib [2025-07-17 14:16:50.852][INFO][429193][7e9jv004] srs checking config... [2025-07-17 14:16:50.853][INFO][429193][7e9jv004] ips, iface[0] eth0 ipv4 0x11043 10.0.20.12, iface[1] eth0 ipv6 0x11043 fe80::5054:ff:fec6:792a%eth0 [2025-07-17 14:16:50.853][INFO][429193][7e9jv004] devices, intranet eth0 10.0.20.12, intranet eth0 fe80::5054:ff:fec6:792a%eth0 [2025-07-17 14:16:50.853][WARN][429193][7e9jv004][22] stats network use index=0, ip=10.0.20.12, ifname=eth0 [2025-07-17 14:16:50.853][WARN][429193][7e9jv004][22] stats disk not configed, disk iops disabled. [2025-07-17 14:16:50.853][INFO][429193][7e9jv004] write log to console [2025-07-17 14:16:50.854][ERROR][429193][7e9jv004][22] Failed, code=1023(ConfigInvalid)(Configuration is invalid) : check config : check normal : illegal vhost.proxy thread [429193][7e9jv004]: do_main() [./src/main/srs_main_server.cpp:225][errno=22] thread [429193][7e9jv004]: check_config() [./src/app/srs_app_config.cpp:2242][errno=22] thread [429193][7e9jv004]: check_normal_config() [./src/app/srs_app_config.cpp:2536][errno=22](Invalid argument) ================================================================= ==429193==ERROR: LeakSanitizer: detected memory leaks Direct leak of 72 byte(s) in 1 object(s) allocated from: #0 0x55580b82dc87 in operator new(unsigned long) (/srs-6.0-d2/trunk/objs/srs+0x4afc87) #1 0x55580b9ee24e in discover_network_iface(ifaddrs*, std::vector<SrsIPAddress*, std::allocator<SrsIPAddress*> >&, std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >&, std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >&, bool, bool) src/protocol/srs_protocol_utility.cpp:703 #2 0x55580b9eef1e in retrieve_local_ips() src/protocol/srs_protocol_utility.cpp:760 #3 0x55580b9ef9e8 in srs_get_local_ips() src/protocol/srs_protocol_utility.cpp:817 #4 0x55580bb78ed5 in SrsConfig::check_normal_config() src/app/srs_app_config.cpp:2424 #5 0x55580bb75e5f in SrsConfig::check_config() src/app/srs_app_config.cpp:2241 #6 0x55580beccb2a in do_main(int, char**, char**) src/main/srs_main_server.cpp:224 #7 0x55580beccea7 in main src/main/srs_main_server.cpp:256 #8 0x7f8136c8a082 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x24082) Direct leak of 72 byte(s) in 1 object(s) allocated from: #0 0x55580b82dc87 in operator new(unsigned long) (/srs-6.0-d2/trunk/objs/srs+0x4afc87) #1 0x55580b9ee24e in discover_network_iface(ifaddrs*, std::vector<SrsIPAddress*, std::allocator<SrsIPAddress*> >&, std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >&, std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >&, bool, bool) src/protocol/srs_protocol_utility.cpp:703 #2 0x55580b9ef220 in retrieve_local_ips() src/protocol/srs_protocol_utility.cpp:781 #3 0x55580b9ef9e8 in srs_get_local_ips() src/protocol/srs_protocol_utility.cpp:817 #4 0x55580bb78ed5 in SrsConfig::check_normal_config() src/app/srs_app_config.cpp:2424 #5 0x55580bb75e5f in SrsConfig::check_config() src/app/srs_app_config.cpp:2241 #6 0x55580beccb2a in do_main(int, char**, char**) src/main/srs_main_server.cpp:224 #7 0x55580beccea7 in main src/main/srs_main_server.cpp:256 #8 0x7f8136c8a082 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x24082) Indirect leak of 31 byte(s) in 1 object(s) allocated from: #0 0x55580b82dc87 in operator new(unsigned long) (/srs-6.0-d2/trunk/objs/srs+0x4afc87) #1 0x7f813710729e in std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_assign(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (/lib/x86_64-linux-gnu/libstdc++.so.6+0x14329e) SUMMARY: AddressSanitizer: 175 byte(s) leaked in 3 allocation(s).
最新发布
07-18
D:\UseApp\jdk1.8.0_101\bin\java.exe -agentlib:jdwp=transport=dt_socket,address=127.0.0.1:54608,suspend=y,server=n -XX:TieredStopAtLevel=1 -noverify -Dspring.output.ansi.enabled=always -Dcom.sun.management.jmxremote -Dspring.jmx.enabled=true -Dspring.liveBeansView.mbeanDomain -Dspring.application.admin.enabled=true -javaagent:D:\UseApp\ideaIU-2020.1.1\plugins\java\lib\rt\debugger-agent.jar=file:/C:/Users/LEGION/AppData/Local/Temp/capture33456.props -Dfile.encoding=UTF-8 -classpath C:\Users\LEGION\AppData\Local\Temp\classpath247044529.jar com.bonc.activityGenerate.ActivityGenerateApplication Connected to the target VM, address: '127.0.0.1:54608', transport: 'socket' 2025-06-10 23:03:33.680 DEBUG 49132 --- [ main] c.a.n.client.env.SearchableProperties : properties search order:PROPERTIES->JVM->ENV 2025-06-10 23:03:33.800 DEBUG 49132 --- [ main] o.s.boot.SpringApplication : Loading source class org.springframework.cloud.bootstrap.BootstrapImportSelectorConfiguration 2025-06-10 23:03:33.819 DEBUG 49132 --- [ main] s.c.a.AnnotationConfigApplicationContext : Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@770d0ea6 2025-06-10 23:03:34.126 INFO 49132 --- [ main] c.a.n.p.a.s.c.ClientAuthPluginManager : [ClientAuthPluginManager] Load ClientAuthService com.alibaba.nacos.client.auth.impl.NacosClientAuthServiceImpl success. 2025-06-10 23:03:34.126 INFO 49132 --- [ main] c.a.n.p.a.s.c.ClientAuthPluginManager : [ClientAuthPluginManager] Load ClientAuthService com.alibaba.nacos.client.auth.ram.RamClientAuthServiceImpl success. 2025-06-10 23:03:34.628 DEBUG 49132 --- [ main] o.s.c.support.DefaultLifecycleProcessor : Starting beans in phase -2147483647 2025-06-10 23:03:34.628 DEBUG 49132 --- [ main] o.s.c.support.DefaultLifecycleProcessor : Successfully started bean 'springBootLoggingLifecycle' 2025-06-10 23:03:34.633 DEBUG 49132 --- [ main] ConditionEvaluationReportLoggingListener : ============================ CONDITIONS EVALUATION REPORT ============================ Positive matches: ----------------- ConfigurationPropertiesRebinderAutoConfiguration matched: - @ConditionalOnBean (types: org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor; SearchStrategy: all) found bean 'org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor' (OnBeanCondition) ConfigurationPropertiesRebinderAutoConfiguration#configurationPropertiesBeans matched: - @ConditionalOnMissingBean (types: org.springframework.cloud.context.properties.ConfigurationPropertiesBeans; SearchStrategy: current) did not find any beans (OnBeanCondition) ConfigurationPropertiesRebinderAutoConfiguration#configurationPropertiesRebinder matched: - @ConditionalOnMissingBean (types: org.springframework.cloud.context.properties.ConfigurationPropertiesRebinder; SearchStrategy: current) did not find any beans (OnBeanCondition) EncryptionBootstrapConfiguration matched: - @ConditionalOnClass found required class 'org.springframework.security.crypto.encrypt.TextEncryptor' (OnClassCondition) EncryptionBootstrapConfiguration#keyProperties matched: - @ConditionalOnMissingBean (types: org.springframework.cloud.bootstrap.encrypt.KeyProperties; SearchStrategy: all) did not find any beans (OnBeanCondition) NacosConfigBootstrapConfiguration matched: - @ConditionalOnProperty (spring.cloud.nacos.config.enabled) matched (OnPropertyCondition) NacosConfigBootstrapConfiguration#nacosConfigManager matched: - @ConditionalOnMissingBean (types: com.alibaba.cloud.nacos.NacosConfigManager; SearchStrategy: all) did not find any beans (OnBeanCondition) NacosConfigBootstrapConfiguration#nacosConfigProperties matched: - @ConditionalOnMissingBean (types: com.alibaba.cloud.nacos.NacosConfigProperties; SearchStrategy: all) did not find any beans (OnBeanCondition) PropertyPlaceholderAutoConfiguration#propertySourcesPlaceholderConfigurer matched: - @ConditionalOnMissingBean (types: org.springframework.context.support.PropertySourcesPlaceholderConfigurer; SearchStrategy: current) did not find any beans (OnBeanCondition) Negative matches: ----------------- EncryptionBootstrapConfiguration.RsaEncryptionConfiguration: Did not match: - Keystore nor key found in Environment (EncryptionBootstrapConfiguration.KeyCondition) Matched: - @ConditionalOnClass found required class 'org.springframework.security.rsa.crypto.RsaSecretEncryptor' (OnClassCondition) EncryptionBootstrapConfiguration.VanillaEncryptionConfiguration: Did not match: - @ConditionalOnMissingClass found unwanted class 'org.springframework.security.rsa.crypto.RsaSecretEncryptor' (OnClassCondition) NacosConfigBootstrapConfiguration#smartConfigurationPropertiesRebinder: Did not match: - @ConditionalOnMissingBean (types: org.springframework.cloud.context.properties.ConfigurationPropertiesRebinder; SearchStrategy: current) found beans of type 'org.springframework.cloud.context.properties.ConfigurationPropertiesRebinder' configurationPropertiesRebinder (OnBeanCondition) NacosDiscoveryClientConfigServiceBootstrapConfiguration: Did not match: - @ConditionalOnClass did not find required class 'org.springframework.cloud.config.client.ConfigServicePropertySourceLocator' (OnClassCondition) Exclusions: ----------- None Unconditional classes: ---------------------- None . ____ _ __ _ _ /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \ ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \ \\/ ___)| |_)| | | | | || (_| | ) ) ) ) ' |____| .__|_| |_|_| |_\__, | / / / / =========|_|==============|___/=/_/_/_/ :: Spring Boot :: (v2.6.11) 2025-06-10 23:03:36.949 INFO 49132 --- [ main] c.a.n.c.a.AbstractAbilityControlManager : Ready to get current node abilities... 2025-06-10 23:03:36.950 INFO 49132 --- [ main] c.a.n.c.a.AbstractAbilityControlManager : Ready to initialize current node abilities, support modes: [SDK_CLIENT] 2025-06-10 23:03:36.951 INFO 49132 --- [ main] c.a.n.c.a.AbstractAbilityControlManager : Initialize current abilities finish... 2025-06-10 23:03:36.951 INFO 49132 --- [ main] c.a.n.c.a.d.NacosAbilityManagerHolder : [AbilityControlManager] Successfully initialize AbilityControlManager 2025-06-10 23:03:37.148 DEBUG 49132 --- [ main] o.s.boot.env.OriginTrackedYamlLoader : Loading from YAML: Byte array resource [redisson-service-prod.yml] 2025-06-10 23:03:37.150 DEBUG 49132 --- [ main] o.s.boot.env.OriginTrackedYamlLoader : Merging document (no matchers set): {spring={mvc={pathmatch={matching-strategy=ANT_PATH_MATCHER}}, http={multipart={enabled=true, max-file-size=-1, max-request-size=-1}}, datasource={dynamic={primary=tri, strict=false, datasource={tri={driver-class-name=com.mysql.jdbc.Driver, url=jdbc:mysql://172.16.50.128:8921/sdiri_db?useSSL=false&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&tinyInt1isBit=false&allowMultiQueries=true&serverTimezone=Asia/Shanghai, username=e_sdiri, password=uHF4CiXAMR5pe3AL, type=com.zaxxer.hikari.HikariDataSource, hikari={maximum-pool-size=40, minimum-idle=1, idle-timeout=30000, connection-timeout=30000, max-lifetime=1800000, pool-name=MyAppPool}}}}}}, tri={activityServerUrl=http://172.16.50.140:30913, activityEditUrl=http://172.16.50.140:30913/bloc-web/#/activity/edit/index/, AIGCGenerateImgServerUrl=http://172.16.20.29:30804/sd-api, standardServerUrl=http://10.135.139.99:30753, yunXiActivityDescUrl=/anlikuHtml/caselibrary.html#/caseIndexSSO, llmServerUrl=http://10.218.27.125:30871, llmModelName=Qwen2.5-32B-Instruct}, logging={config=classpath:logback-spring.xml}, feign={httpclient={max-connections-per-route=200, max-connections=1000}, circuitbreaker={enabled=true}, client={config={default={connect-timeout=300000, read-timeout=300000}}}}, server={port=31963, servlet={context-path=/act}}, login={skipUrls=[/user/login, /user/getLoginCode, /user/register, /task/logWebsocket, /server/**/api/chat, /wsApiChat, /server/serverDesc/**, /server/openServerList, /server/aiCloudPhone/**, /open/jiKe/**, /**/*.html, /**/*.js, /**/*.css, /**/*.icon, /**/*.gif, /**/*.jpg, /**/*.png, /chat/**, /swagger-resources/**, /v2/]}} 2025-06-10 23:03:37.150 DEBUG 49132 --- [ main] o.s.boot.env.OriginTrackedYamlLoader : Loaded 1 document from YAML resource: Byte array resource [redisson-service-prod.yml] 2025-06-10 23:03:37.177 WARN 49132 --- [ main] c.a.c.n.c.NacosPropertySourceBuilder : Ignore the empty nacos configuration and get it based on dataId[redisson-service] & group[DEFAULT_GROUP] 2025-06-10 23:03:37.183 WARN 49132 --- [ main] c.a.c.n.c.NacosPropertySourceBuilder : Ignore the empty nacos configuration and get it based on dataId[redisson-service.yml] & group[DEFAULT_GROUP] 2025-06-10 23:03:37.253 DEBUG 49132 --- [ main] o.s.boot.env.OriginTrackedYamlLoader : Loading from YAML: Byte array resource [redisson-service-prod.yml] 2025-06-10 23:03:37.261 DEBUG 49132 --- [ main] o.s.boot.env.OriginTrackedYamlLoader : Merging document (no matchers set): {spring={mvc={pathmatch={matching-strategy=ANT_PATH_MATCHER}}, http={multipart={enabled=true, max-file-size=-1, max-request-size=-1}}, datasource={dynamic={primary=tri, strict=false, datasource={tri={driver-class-name=com.mysql.jdbc.Driver, url=jdbc:mysql://172.16.50.128:8921/sdiri_db?useSSL=false&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&tinyInt1isBit=false&allowMultiQueries=true&serverTimezone=Asia/Shanghai, username=e_sdiri, password=uHF4CiXAMR5pe3AL, type=com.zaxxer.hikari.HikariDataSource, hikari={maximum-pool-size=40, minimum-idle=1, idle-timeout=30000, connection-timeout=30000, max-lifetime=1800000, pool-name=MyAppPool}}}}}}, tri={activityServerUrl=http://172.16.50.140:30913, activityEditUrl=http://172.16.50.140:30913/bloc-web/#/activity/edit/index/, AIGCGenerateImgServerUrl=http://172.16.20.29:30804/sd-api, standardServerUrl=http://10.135.139.99:30753, yunXiActivityDescUrl=/anlikuHtml/caselibrary.html#/caseIndexSSO, llmServerUrl=http://10.218.27.125:30871, llmModelName=Qwen2.5-32B-Instruct}, logging={config=classpath:logback-spring.xml}, feign={httpclient={max-connections-per-route=200, max-connections=1000}, circuitbreaker={enabled=true}, client={config={default={connect-timeout=300000, read-timeout=300000}}}}, server={port=31963, servlet={context-path=/act}}, login={skipUrls=[/user/login, /user/getLoginCode, /user/register, /task/logWebsocket, /server/**/api/chat, /wsApiChat, /server/serverDesc/**, /server/openServerList, /server/aiCloudPhone/**, /open/jiKe/**, /**/*.html, /**/*.js, /**/*.css, /**/*.icon, /**/*.gif, /**/*.jpg, /**/*.png, /chat/**, /swagger-resources/**, /v2/]}} 2025-06-10 23:03:37.261 DEBUG 49132 --- [ main] o.s.boot.env.OriginTrackedYamlLoader : Loaded 1 document from YAML resource: Byte array resource [redisson-service-prod.yml] 2025-06-10 23:03:37.262 INFO 49132 --- [ main] b.c.PropertySourceBootstrapConfiguration : Located property source: [BootstrapPropertySource@58791184 {name='bootstrapProperties-redisson-service-prod.yml,DEFAULT_GROUP', properties={spring.mvc.pathmatch.matching-strategy=ANT_PATH_MATCHER, spring.http.multipart.enabled=true, spring.http.multipart.max-file-size=-1, spring.http.multipart.max-request-size=-1, spring.datasource.dynamic.primary=tri, spring.datasource.dynamic.strict=false, spring.datasource.dynamic.datasource.tri.driver-class-name=com.mysql.jdbc.Driver, spring.datasource.dynamic.datasource.tri.url=jdbc:mysql://172.16.50.128:8921/sdiri_db?useSSL=false&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&tinyInt1isBit=false&allowMultiQueries=true&serverTimezone=Asia/Shanghai, spring.datasource.dynamic.datasource.tri.username=e_sdiri, spring.datasource.dynamic.datasource.tri.password=uHF4CiXAMR5pe3AL, spring.datasource.dynamic.datasource.tri.type=com.zaxxer.hikari.HikariDataSource, spring.datasource.dynamic.datasource.tri.hikari.maximum-pool-size=40, spring.datasource.dynamic.datasource.tri.hikari.minimum-idle=1, spring.datasource.dynamic.datasource.tri.hikari.idle-timeout=30000, spring.datasource.dynamic.datasource.tri.hikari.connection-timeout=30000, spring.datasource.dynamic.datasource.tri.hikari.max-lifetime=1800000, spring.datasource.dynamic.datasource.tri.hikari.pool-name=MyAppPool, tri.activityServerUrl=http://172.16.50.140:30913, tri.activityEditUrl=http://172.16.50.140:30913/bloc-web/#/activity/edit/index/, tri.AIGCGenerateImgServerUrl=http://172.16.20.29:30804/sd-api, tri.standardServerUrl=http://10.135.139.99:30753, tri.yunXiActivityDescUrl=/anlikuHtml/caselibrary.html#/caseIndexSSO, tri.llmServerUrl=http://10.218.27.125:30871, tri.llmModelName=Qwen2.5-32B-Instruct, logging.config=classpath:logback-spring.xml, feign.httpclient.max-connections-per-route=200, feign.httpclient.max-connections=1000, feign.circuitbreaker.enabled=true, feign.client.config.default.connect-timeout=300000, feign.client.config.default.read-timeout=300000, server.port=31963, server.servlet.context-path=/act, login.skipUrls[0]=/user/login, login.skipUrls[1]=/user/getLoginCode, login.skipUrls[2]=/user/register, login.skipUrls[3]=/task/logWebsocket, login.skipUrls[4]=/server/**/api/chat, login.skipUrls[5]=/wsApiChat, login.skipUrls[6]=/server/serverDesc/**, login.skipUrls[7]=/server/openServerList, login.skipUrls[8]=/server/aiCloudPhone/**, login.skipUrls[9]=/open/jiKe/**, login.skipUrls[10]=/**/*.html, login.skipUrls[11]=/**/*.js, login.skipUrls[12]=/**/*.css, login.skipUrls[13]=/**/*.icon, login.skipUrls[14]=/**/*.gif, login.skipUrls[15]=/**/*.jpg, login.skipUrls[16]=/**/*.png, login.skipUrls[17]=/chat/**, login.skipUrls[18]=/swagger-resources/**, login.skipUrls[19]=/v2/}}, BootstrapPropertySource@619621481 {name='bootstrapProperties-redisson-service.yml,DEFAULT_GROUP', properties={}}, BootstrapPropertySource@408132785 {name='bootstrapProperties-redisson-service,DEFAULT_GROUP', properties={}}] _ _ |_ _ _|_. ___ _ | _ | | |\/|_)(_| | |_\ |_)||_|_\ / | 3.4.1 项目启动卡到这里不动了,怎么解决?
06-11
BOOL CKA026_TIN_PCBTestToolV10Dlg::PreTranslateMessage(MSG* pMsg) { CString s; //USES_CONVERSION; /*if((b_AutoTesting || b_ManualTesting) && (IsDlgButtonChecked(IDC_CHK_KeyTest)==BST_CHECKED || IsDlgButtonChecked(IDC_CHK_KeyAutoTest)==BST_CHECKED || IsDlgButtonChecked(IDC_CHK_FrequencyTest)==BST_CHECKED)) {*/ if(Autotest==true||IsDlgButtonChecked(IDC_CHECK_manual_test)==BST_CHECKED&&keytesting==true) { if (pMsg->message == WM_KEYUP || pMsg->message == WM_SYSKEYUP)// || pMsg->message == WM_SYSCHAR ) { char cKey[32]={0}; TCHAR szKeyName[32] ={0}; GetKeyNameText(pMsg->lParam,szKeyName,sizeof (szKeyName) / sizeof (TCHAR)); strcpy(cKey,szKeyName); //---------- /*if (IsDlgButtonChecked(IDC_CHK_DebugLog)==BST_CHECKED) { SYSTEMTIME cur_time; char m_cTimeBuf[200]; GetLocalTime(&cur_time); sprintf_s(m_cTimeBuf, sizeof(m_cTimeBuf), "%04d-%02d-%02d %02d:%02d:%02d.%03d:pMsg->message=%X,pMsg->wParam=%d,KeyName=%s", cur_time.wYear,cur_time.wMonth,cur_time.wDay,cur_time.wHour, cur_time.wMinute, cur_time.wSecond, cur_time.wMilliseconds,pMsg->message,pMsg->wParam,cKey); InsertItem_Debug(m_cTimeBuf,0); }*/ //---------- //s.Format(_T("%d"),pMsg->wParam); //AfxMessageBox(s); if(pMsg->wParam==27) { m_Label_Key[0].SetBkColor(RGB(0, 255, 0)); b_keyok[0]=true; } else if(pMsg->wParam==49)//1 { m_Label_Key[1].SetBkColor(RGB(0, 255, 0)); b_keyok[1]=true; } else if(pMsg->wParam==50)//2 { m_Label_Key[2].SetBkColor(RGB(0, 255, 0)); b_keyok[2]=true; } else if(pMsg->wParam==51)//3 { m_Label_Key[3].SetBkColor(RGB(0, 255, 0)); b_keyok[3]=true; } else if(pMsg->wParam==52)//4 { m_Label_Key[4].SetBkColor(RGB(0, 255, 0)); b_keyok[4]=true; } else if(pMsg->wParam==53)//5 { m_Label_Key[5].SetBkColor(RGB(0, 255, 0)); b_keyok[5]=true; } else if(pMsg->wParam==54)//6 { m_Label_Key[6].SetBkColor(RGB(0, 255, 0)); b_keyok[6]=true; } else if(pMsg->wParam==55)//7 { m_Label_Key[7].SetBkColor(RGB(0, 255, 0)); b_keyok[7]=true; } else if(pMsg->wParam==56)//8 { m_Label_Key[8].SetBkColor(RGB(0, 255, 0)); b_keyok[8]=true; } else if(pMsg->wParam==57)//9 { m_Label_Key[9].SetBkColor(RGB(0, 255, 0)); b_keyok[9]=true; } else if(pMsg->wParam==48)//0 { m_Label_Key[10].SetBkColor(RGB(0, 255, 0)); b_keyok[10]=true; } else if(pMsg->wParam==189)//_ { m_Label_Key[11].SetBkColor(RGB(0, 255, 0)); b_keyok[11]=true; } else if(pMsg->wParam==187)//= { m_Label_Key[12].SetBkColor(RGB(0, 255, 0)); b_keyok[12]=true; } else if(pMsg->wParam==8 && stricmp(cKey,"Backspace")==0) //backspace { m_Label_Key[13].SetBkColor(RGB(0, 255, 0)); b_keyok[13]=true; } else if(pMsg->wParam==9)//TAB { m_Label_Key[14].SetBkColor(RGB(0, 255, 0)); b_keyok[14]=true; } else if(pMsg->wParam==81)//Q { m_Label_Key[15].SetBkColor(RGB(0, 255, 0)); b_keyok[15]=true; } else if(pMsg->wParam==87)//W { m_Label_Key[16].SetBkColor(RGB(0, 255, 0)); b_keyok[16]=true; } else if(pMsg->wParam==69)//E { m_Label_Key[17].SetBkColor(RGB(0, 255, 0)); b_keyok[17]=true; } else if(pMsg->wParam==82)//R { m_Label_Key[18].SetBkColor(RGB(0, 255, 0)); b_keyok[18]=true; } else if(pMsg->wParam==84)//T { m_Label_Key[19].SetBkColor(RGB(0, 255, 0)); b_keyok[19]=true; } else if(pMsg->wParam==89)//Y { m_Label_Key[20].SetBkColor(RGB(0, 255, 0)); b_keyok[20]=true; } else if(pMsg->wParam==85)//U { m_Label_Key[21].SetBkColor(RGB(0, 255, 0)); b_keyok[21]=true; } else if(pMsg->wParam==73)//I { m_Label_Key[22].SetBkColor(RGB(0, 255, 0)); b_keyok[22]=true; } else if(pMsg->wParam==79)//O { m_Label_Key[23].SetBkColor(RGB(0, 255, 0)); b_keyok[23]=true; } else if(pMsg->wParam==80)//P { m_Label_Key[24].SetBkColor(RGB(0, 255, 0)); b_keyok[24]=true; } else if(pMsg->wParam==219)//[ { m_Label_Key[25].SetBkColor(RGB(0, 255, 0)); b_keyok[25]=true; } else if(pMsg->wParam==221)//] { m_Label_Key[26].SetBkColor(RGB(0, 255, 0)); b_keyok[26]=true; } else if(pMsg->wParam==220)// | { m_Label_Key[27].SetBkColor(RGB(0, 255, 0)); b_keyok[27]=true; } else if(pMsg->wParam==20)//CAP { m_Label_Key[28].SetBkColor(RGB(0, 255, 0)); b_keyok[28]=true; } else if(pMsg->wParam==65)//A { m_Label_Key[29].SetBkColor(RGB(0, 255, 0)); b_keyok[29]=true; } else if(pMsg->wParam==83)//S { m_Label_Key[30].SetBkColor(RGB(0, 255, 0)); b_keyok[30]=true; } else if(pMsg->wParam==68)//D { m_Label_Key[31].SetBkColor(RGB(0, 255, 0)); b_keyok[31]=true; } else if(pMsg->wParam==70)//F { m_Label_Key[32].SetBkColor(RGB(0, 255, 0)); b_keyok[32]=true; } else if(pMsg->wParam==71)//G { m_Label_Key[33].SetBkColor(RGB(0, 255, 0)); b_keyok[33]=true; } else if(pMsg->wParam==72)//H { m_Label_Key[34].SetBkColor(RGB(0, 255, 0)); b_keyok[34]=true; } else if(pMsg->wParam==74)//J { m_Label_Key[35].SetBkColor(RGB(0, 255, 0)); b_keyok[35]=true; } else if(pMsg->wParam==75)//K { m_Label_Key[36].SetBkColor(RGB(0, 255, 0)); b_keyok[36]=true; } else if(pMsg->wParam==76)//L { m_Label_Key[37].SetBkColor(RGB(0, 255, 0)); b_keyok[37]=true; } else if(pMsg->wParam==186)//; { m_Label_Key[38].SetBkColor(RGB(0, 255, 0)); b_keyok[38]=true; } else if(pMsg->wParam==222)//" { m_Label_Key[39].SetBkColor(RGB(0, 255, 0)); b_keyok[39]=true; } else if(pMsg->wParam==13)//Enter { m_Label_Key[40].SetBkColor(RGB(0, 255, 0)); b_keyok[40]=true; } else if(pMsg->wParam==16 && stricmp(cKey,"Shift")==0)//shift1 { m_Label_Key[41].SetBkColor(RGB(0, 255, 0)); b_keyok[41]=true; } else if(pMsg->wParam==90)//Z { m_Label_Key[42].SetBkColor(RGB(0, 255, 0)); b_keyok[42]=true; } else if(pMsg->wParam==88)//X { m_Label_Key[43].SetBkColor(RGB(0, 255, 0)); b_keyok[43]=true; } else if(pMsg->wParam==67)//C { m_Label_Key[44].SetBkColor(RGB(0, 255, 0)); b_keyok[44]=true; } else if(pMsg->wParam==86)//V { m_Label_Key[45].SetBkColor(RGB(0, 255, 0)); b_keyok[45]=true; } else if(pMsg->wParam==66)//B { m_Label_Key[46].SetBkColor(RGB(0, 255, 0)); b_keyok[46]=true; } else if(pMsg->wParam==78)//N { m_Label_Key[47].SetBkColor(RGB(0, 255, 0)); b_keyok[47]=true; } else if(pMsg->wParam==77)//M { m_Label_Key[48].SetBkColor(RGB(0, 255, 0)); b_keyok[48]=true; } else if(pMsg->wParam==188)//< { m_Label_Key[49].SetBkColor(RGB(0, 255, 0)); b_keyok[49]=true; } else if(pMsg->wParam==190)//> { m_Label_Key[50].SetBkColor(RGB(0, 255, 0)); b_keyok[50]=true; } else if(pMsg->wParam==191)//? { m_Label_Key[51].SetBkColor(RGB(0, 255, 0)); b_keyok[51]=true; } else if(pMsg->wParam==16 && stricmp(cKey,"Right Shift")==0)//shift2 { m_Label_Key[52].SetBkColor(RGB(0, 255, 0)); b_keyok[52]=true; } else if(pMsg->wParam==17 && stricmp(cKey,"Ctrl")==0)//Ctrl1 { m_Label_Key[53].SetBkColor(RGB(0, 255, 0)); b_keyok[53]=true; } //else if(pMsg->wParam==135)//Fn //{ // m_Label_Key[54].SetBkColor(RGB(0, 255, 0)); // b_keyok[54]=true; //} else if(pMsg->wParam==127)//WINWOWS 91 现用:125 { m_Label_Key[54].SetBkColor(RGB(0, 255, 0)); b_keyok[54]=true; //-模拟按下,弹起windows key,关闭该功能键弹出的窗口 //if(!b_winPress) //{ // Sleep(500); // keybd_event(91,0,0,0); //key down // Sleep(500); // keybd_event(91,0,KEYEVENTF_KEYUP,0);//key up // b_winPress=true; //} //- } else if(pMsg->wParam==18 && stricmp(cKey,"Alt")==0)//Alt1 { m_Label_Key[55].SetBkColor(RGB(0, 255, 0)); b_keyok[55]=true; } else if(pMsg->wParam==32)//Space { m_Label_Key[56].SetBkColor(RGB(0, 255, 0)); b_keyok[56]=true; } else if(pMsg->wParam==18 && stricmp(cKey,"Right Alt")==0)//Alt2 { m_Label_Key[57].SetBkColor(RGB(0, 255, 0)); b_keyok[57]=true; } else if(pMsg->wParam==17 && stricmp(cKey,"Right Ctrl")==0)//Ctrl2 { m_Label_Key[58].SetBkColor(RGB(0, 255, 0)); b_keyok[58]=true; } else if(pMsg->wParam==37)//Left { m_Label_Key[59].SetBkColor(RGB(0, 255, 0)); b_keyok[59]=true; } else if(pMsg->wParam==38)//PgUp { m_Label_Key[60].SetBkColor(RGB(0, 255, 0)); b_keyok[60]=true; } else if(pMsg->wParam==40)//PgDn { m_Label_Key[61].SetBkColor(RGB(0, 255, 0)); b_keyok[61]=true; } else if(pMsg->wParam==39)//Right { m_Label_Key[62].SetBkColor(RGB(0, 255, 0)); b_keyok[62]=true; }//[64]-[69] sensor touchpannel test else if(pMsg->wParam==192) { m_Label_Key[63].SetBkColor(RGB(0, 255, 0)); b_keyok[63]=true; } else if(pMsg->wParam==112)//F1 VK_F1 需要屏蔽F1功能 OnHelpInfo()//消息队列中去重构 { m_Label_Key[64].SetBkColor(RGB(0, 255, 0)); b_keyok[64]=true; } else if(pMsg->wParam==113)//F2 { m_Label_Key[65].SetBkColor(RGB(0, 255, 0)); b_keyok[65]=true; } //else if(pMsg->wParam==124)// //{ // m_Label_Key[66].SetBkColor(RGB(0, 255, 0)); // b_keyok[66]=true; //} //else if(pMsg->wParam==133)// //{ // m_Label_Key[67].SetBkColor(RGB(0, 255, 0)); // b_keyok[67]=true; //} else if(pMsg->wParam==114)// { m_Label_Key[66].SetBkColor(RGB(0, 255, 0)); b_keyok[66]=true; } else if(pMsg->wParam==115)// { m_Label_Key[67].SetBkColor(RGB(0, 255, 0)); b_keyok[67]=true; } else if(pMsg->wParam==116)// { m_Label_Key[68].SetBkColor(RGB(0, 255, 0)); b_keyok[68]=true; } //else if(pMsg->wParam==128)// //{ // m_Label_Key[69].SetBkColor(RGB(0, 255, 0)); // b_keyok[69]=true; //} else if(pMsg->wParam==117)// { m_Label_Key[69].SetBkColor(RGB(0, 255, 0)); b_keyok[69]=true; } else if(pMsg->wParam==118)//F7 { m_Label_Key[70].SetBkColor(RGB(0, 255, 0)); b_keyok[70]=true; } else if(pMsg->wParam==120)//F8 { m_Label_Key[71].SetBkColor(RGB(0, 255, 0)); b_keyok[71]=true; } else if(pMsg->wParam==121)//F9 { m_Label_Key[72].SetBkColor(RGB(0, 255, 0)); b_keyok[72]=true; } else if(pMsg->wParam==123)//F10 { m_Label_Key[73].SetBkColor(RGB(0, 255, 0)); b_keyok[73]=true; } else if(pMsg->wParam==122)//F12 { m_Label_Key[76].SetBkColor(RGB(0, 255, 0)); b_keyok[76]=true; } else if(pMsg->wParam==132)//F12 { m_Label_Key[77].SetBkColor(RGB(0, 255, 0)); b_keyok[77]=true; } else if(pMsg->wParam==46) { m_Label_Key[74].SetBkColor(RGB(0, 255, 0)); b_keyok[74]=true; } else if(pMsg->wParam==119) { m_Label_Key[75].SetBkColor(RGB(0, 255, 0)); b_keyok[75]=true; } /* else if(pMsg->wParam==124)//FnLock { m_Label_Key[70].SetBkColor(RGB(0, 255, 0)); b_keyok[70]=true; } else if(pMsg->wParam==112)//F1 VK_F1 需要屏蔽F1功能 OnHelpInfo() { m_Label_Key[71].SetBkColor(RGB(0, 255, 0)); b_keyok[71]=true; } else if(pMsg->wParam==113)//F2 { m_Label_Key[72].SetBkColor(RGB(0, 255, 0)); b_keyok[72]=true; } else if(pMsg->wParam==114)//F3 { m_Label_Key[73].SetBkColor(RGB(0, 255, 0)); b_keyok[73]=true; } else if(pMsg->wParam==115)//F4 { m_Label_Key[74].SetBkColor(RGB(0, 255, 0)); b_keyok[74]=true; } else if(pMsg->wParam==116)//F5 { m_Label_Key[75].SetBkColor(RGB(0, 255, 0)); b_keyok[75]=true; } else if(pMsg->wParam==117)//F6 { m_Label_Key[76].SetBkColor(RGB(0, 255, 0)); b_keyok[76]=true; } else if(pMsg->wParam==118)//F7 { m_Label_Key[77].SetBkColor(RGB(0, 255, 0)); b_keyok[77]=true; } else if(pMsg->wParam==44)//F8 { m_Label_Key[78].SetBkColor(RGB(0, 255, 0)); b_keyok[78]=true; } else if(pMsg->wParam==120)//F9 { m_Label_Key[79].SetBkColor(RGB(0, 255, 0)); b_keyok[79]=true; } else if(pMsg->wParam==121)//F10 { m_Label_Key[80].SetBkColor(RGB(0, 255, 0)); b_keyok[80]=true; } else if(pMsg->wParam==122)//F11 { m_Label_Key[81].SetBkColor(RGB(0, 255, 0)); b_keyok[81]=true; } else if(pMsg->wParam==123)//F12 { m_Label_Key[82].SetBkColor(RGB(0, 255, 0)); b_keyok[82]=true; } else if(pMsg->wParam==125)//APPP1 PrtSc { m_Label_Key[83].SetBkColor(RGB(0, 255, 0)); b_keyok[83]=true; } else if(pMsg->wParam==126)//APP2 Insert { m_Label_Key[84].SetBkColor(RGB(0, 255, 0)); b_keyok[84]=true; } else if(pMsg->wParam==46)//Delete { m_Label_Key[85].SetBkColor(RGB(0, 255, 0)); b_keyok[85]=true; } */ return TRUE; } else if (pMsg->message == WM_KEYDOWN || pMsg->message == WM_SYSKEYDOWN) { char cKey[32]={0}; TCHAR szKeyName[32] ={0}; GetKeyNameText(pMsg->lParam,szKeyName,sizeof (szKeyName) / sizeof (TCHAR)) ; strcpy(cKey,szKeyName); //---------- /*if (IsDlgButtonChecked(IDC_CHK_DebugLog)==BST_CHECKED) { SYSTEMTIME cur_time; char m_cTimeBuf[200]; GetLocalTime(&cur_time); sprintf_s(m_cTimeBuf, sizeof(m_cTimeBuf), "%04d-%02d-%02d %02d:%02d:%02d.%03d:pMsg->message=%X,pMsg->wParam=%d,KeyName=%s", cur_time.wYear,cur_time.wMonth,cur_time.wDay,cur_time.wHour, cur_time.wMinute, cur_time.wSecond, cur_time.wMilliseconds,pMsg->message,pMsg->wParam,cKey); InsertItem_Debug(m_cTimeBuf,0); }*/ //---------- if(pMsg->wParam==27) { m_Label_Key[0].SetBkColor(RGB(255, 255, 0)); b_keyok[0]=false; } else if(pMsg->wParam==49)//1 { m_Label_Key[1].SetBkColor(RGB(255, 255, 0)); b_keyok[1]=false; } else if(pMsg->wParam==50)//2 { m_Label_Key[2].SetBkColor(RGB(255, 255, 0)); b_keyok[2]=false; } else if(pMsg->wParam==51)//3 { m_Label_Key[3].SetBkColor(RGB(255, 255, 0)); b_keyok[3]=false; } else if(pMsg->wParam==52)//4 { m_Label_Key[4].SetBkColor(RGB(255, 255, 0)); b_keyok[4]=false; } else if(pMsg->wParam==53)//5 { m_Label_Key[5].SetBkColor(RGB(255, 255, 0)); b_keyok[5]=false; } else if(pMsg->wParam==54)//6 { m_Label_Key[6].SetBkColor(RGB(255, 255, 0)); b_keyok[6]=false; } else if(pMsg->wParam==55)//7 { m_Label_Key[7].SetBkColor(RGB(255, 255, 0)); b_keyok[7]=false; } else if(pMsg->wParam==56)//8 { m_Label_Key[8].SetBkColor(RGB(255, 255, 0)); b_keyok[8]=false; } else if(pMsg->wParam==57)//9 { m_Label_Key[9].SetBkColor(RGB(255, 255, 0)); b_keyok[9]=false; } else if(pMsg->wParam==48)//0 { m_Label_Key[10].SetBkColor(RGB(255, 255, 0)); b_keyok[10]=false; } else if(pMsg->wParam==189)//_ { m_Label_Key[11].SetBkColor(RGB(255, 255, 0)); b_keyok[11]=false; } else if(pMsg->wParam==187)//= { m_Label_Key[12].SetBkColor(RGB(255, 255, 0)); b_keyok[12]=false; } else if(pMsg->wParam==8 && stricmp(cKey,"Backspace")==0) //backspace { m_Label_Key[13].SetBkColor(RGB(255, 255, 0)); b_keyok[13]=false; } else if(pMsg->wParam==9)//TAB { m_Label_Key[14].SetBkColor(RGB(255, 255, 0)); b_keyok[14]=false; } else if(pMsg->wParam==81)//Q { m_Label_Key[15].SetBkColor(RGB(255, 255, 0)); b_keyok[15]=false; } else if(pMsg->wParam==87)//W { m_Label_Key[16].SetBkColor(RGB(255, 255, 0)); b_keyok[16]=false; } else if(pMsg->wParam==69)//E { m_Label_Key[17].SetBkColor(RGB(255, 255, 0)); b_keyok[17]=false; } else if(pMsg->wParam==82)//R { m_Label_Key[18].SetBkColor(RGB(255, 255, 0)); b_keyok[18]=false; } else if(pMsg->wParam==84)//T { m_Label_Key[19].SetBkColor(RGB(255, 255, 0)); b_keyok[19]=false; } else if(pMsg->wParam==89)//Y { m_Label_Key[20].SetBkColor(RGB(255, 255, 0)); b_keyok[20]=false; } else if(pMsg->wParam==85)//U { m_Label_Key[21].SetBkColor(RGB(255, 255, 0)); b_keyok[21]=false; } else if(pMsg->wParam==73)//I { m_Label_Key[22].SetBkColor(RGB(255, 255, 0)); b_keyok[22]=false; } else if(pMsg->wParam==79)//O { m_Label_Key[23].SetBkColor(RGB(255, 255, 0)); b_keyok[23]=false; } else if(pMsg->wParam==80)//P { m_Label_Key[24].SetBkColor(RGB(255, 255, 0)); b_keyok[24]=false; } else if(pMsg->wParam==219)//[ { m_Label_Key[25].SetBkColor(RGB(255, 255, 0)); b_keyok[25]=false; } else if(pMsg->wParam==221)//] { m_Label_Key[26].SetBkColor(RGB(255, 255, 0)); b_keyok[26]=false; } else if(pMsg->wParam==220)// | { m_Label_Key[27].SetBkColor(RGB(255, 255, 0)); b_keyok[27]=false; } else if(pMsg->wParam==20)//CAP { m_Label_Key[28].SetBkColor(RGB(255, 255, 0)); b_keyok[28]=false; } else if(pMsg->wParam==65)//A { m_Label_Key[29].SetBkColor(RGB(255, 255, 0)); b_keyok[29]=false; } else if(pMsg->wParam==83)//S { m_Label_Key[30].SetBkColor(RGB(255, 255, 0)); b_keyok[30]=false; } else if(pMsg->wParam==68)//D { m_Label_Key[31].SetBkColor(RGB(255, 255, 0)); b_keyok[31]=false; } else if(pMsg->wParam==70)//F { m_Label_Key[32].SetBkColor(RGB(255, 255, 0)); b_keyok[32]=false; } else if(pMsg->wParam==71)//G { m_Label_Key[33].SetBkColor(RGB(255, 255, 0)); b_keyok[33]=false; } else if(pMsg->wParam==72)//H { m_Label_Key[34].SetBkColor(RGB(255, 255, 0)); b_keyok[34]=false; } else if(pMsg->wParam==74)//J { m_Label_Key[35].SetBkColor(RGB(255, 255, 0)); b_keyok[35]=false; } else if(pMsg->wParam==75)//K { m_Label_Key[36].SetBkColor(RGB(255, 255, 0)); b_keyok[36]=false; } else if(pMsg->wParam==76)//L { m_Label_Key[37].SetBkColor(RGB(255, 255, 0)); b_keyok[37]=false; } else if(pMsg->wParam==186)//; { m_Label_Key[38].SetBkColor(RGB(255, 255, 0)); b_keyok[38]=false; } else if(pMsg->wParam==222)//" { m_Label_Key[39].SetBkColor(RGB(255, 255, 0)); b_keyok[39]=false; } else if(pMsg->wParam==13)//Enter { m_Label_Key[40].SetBkColor(RGB(255, 255, 0)); b_keyok[40]=false; } else if(pMsg->wParam==16 && stricmp(cKey,"Shift")==0)//shift1 { m_Label_Key[41].SetBkColor(RGB(255, 255, 0)); b_keyok[41]=false; } else if(pMsg->wParam==90)//Z { m_Label_Key[42].SetBkColor(RGB(255, 255, 0)); b_keyok[42]=false; } else if(pMsg->wParam==88)//X { m_Label_Key[43].SetBkColor(RGB(255, 255, 0)); b_keyok[43]=false; } else if(pMsg->wParam==67)//C { m_Label_Key[44].SetBkColor(RGB(255, 255, 0)); b_keyok[44]=false; } else if(pMsg->wParam==86)//V { m_Label_Key[45].SetBkColor(RGB(255, 255, 0)); b_keyok[45]=false; } else if(pMsg->wParam==66)//B { m_Label_Key[46].SetBkColor(RGB(255, 255, 0)); b_keyok[46]=false; } else if(pMsg->wParam==78)//N { m_Label_Key[47].SetBkColor(RGB(255, 255, 0)); b_keyok[47]=false; } else if(pMsg->wParam==77)//M { m_Label_Key[48].SetBkColor(RGB(255, 255, 0)); b_keyok[48]=false; } else if(pMsg->wParam==188)//< { m_Label_Key[49].SetBkColor(RGB(255, 255, 0)); b_keyok[49]=false; } else if(pMsg->wParam==190)//> { m_Label_Key[50].SetBkColor(RGB(255, 255, 0)); b_keyok[50]=false; } else if(pMsg->wParam==191)//? { m_Label_Key[51].SetBkColor(RGB(255, 255, 0)); b_keyok[51]=false; } else if(pMsg->wParam==16 && stricmp(cKey,"Right Shift")==0)//shift2 { m_Label_Key[52].SetBkColor(RGB(255, 255, 0)); b_keyok[52]=false; } else if(pMsg->wParam==17 && stricmp(cKey,"Ctrl")==0)//Ctrl1 { m_Label_Key[53].SetBkColor(RGB(255, 255, 0)); b_keyok[53]=false; } //else if(pMsg->wParam==135)//Fn //{ // m_Label_Key[54].SetBkColor(RGB(255, 255, 0)); // b_keyok[54]=false; //} else if(pMsg->wParam==127)//WINWOWS 91,现用125 { m_Label_Key[54].SetBkColor(RGB(255, 255, 0)); b_keyok[54]=false; //-模拟按下,弹起windows key,关闭该功能键弹出的窗口 //keybd_event(91,0,0,0); //key down //keybd_event(91,0,KEYEVENTF_KEYUP,0);//key up //- } else if(pMsg->wParam==18 && stricmp(cKey,"Alt")==0)//Alt1 { m_Label_Key[55].SetBkColor(RGB(255, 255, 0)); b_keyok[55]=false; } else if(pMsg->wParam==32)//Space { m_Label_Key[56].SetBkColor(RGB(255, 255, 0)); b_keyok[56]=false; } else if(pMsg->wParam==18 && stricmp(cKey,"Right Alt")==0)//Alt2 { m_Label_Key[57].SetBkColor(RGB(255, 255, 0)); b_keyok[57]=false; } else if(pMsg->wParam==17 && stricmp(cKey,"Right Ctrl")==0)//Ctrl2 { m_Label_Key[58].SetBkColor(RGB(255, 255, 0)); b_keyok[58]=false; } else if(pMsg->wParam==37)//Left { m_Label_Key[59].SetBkColor(RGB(255, 255, 0)); b_keyok[59]=false; } else if(pMsg->wParam==38)//PgUp { m_Label_Key[60].SetBkColor(RGB(255, 255, 0)); b_keyok[60]=false; } else if(pMsg->wParam==40)//PgDn { m_Label_Key[61].SetBkColor(RGB(255, 255, 0)); b_keyok[61]=false; } else if(pMsg->wParam==39)//Right { m_Label_Key[62].SetBkColor(RGB(255, 255, 0)); b_keyok[62]=false; }//[64]-[69] sensor touchpannel test else if(pMsg->wParam==192) { m_Label_Key[63].SetBkColor(RGB(255, 255, 0)); b_keyok[63]=false; } else if(pMsg->wParam==112)//F1 VK_F1 需要屏蔽F1功能 OnHelpInfo() { m_Label_Key[64].SetBkColor(RGB(255, 255, 0)); b_keyok[64]=false; } else if(pMsg->wParam==113)//F2 { m_Label_Key[65].SetBkColor(RGB(255, 255, 0)); b_keyok[65]=false; } //else if(pMsg->wParam==124)// //{ // m_Label_Key[66].SetBkColor(RGB(255, 255, 0)); // b_keyok[66]=false; //} //else if(pMsg->wParam==133)// //{ // m_Label_Key[67].SetBkColor(RGB(255, 255, 0)); // b_keyok[67]=false; //} else if(pMsg->wParam==114)// { m_Label_Key[66].SetBkColor(RGB(255, 255, 0)); b_keyok[66]=false; } else if(pMsg->wParam==115)// { m_Label_Key[67].SetBkColor(RGB(255, 255, 0)); b_keyok[67]=false; } else if(pMsg->wParam==116)// { m_Label_Key[68].SetBkColor(RGB(255, 255, 0)); b_keyok[68]=false; } //else if(pMsg->wParam==128)// //{ // m_Label_Key[69].SetBkColor(RGB(255, 255, 0)); // b_keyok[69]=false; //} else if(pMsg->wParam==117)// { m_Label_Key[69].SetBkColor(RGB(255, 255, 0)); b_keyok[69]=false; } else if(pMsg->wParam==118)//F7 { m_Label_Key[70].SetBkColor(RGB(255, 255, 0)); b_keyok[70]=false; } else if(pMsg->wParam==120)//F8 { m_Label_Key[71].SetBkColor(RGB(255, 255, 0)); b_keyok[71]=false; } else if(pMsg->wParam==121)//F9 { m_Label_Key[72].SetBkColor(RGB(255, 255, 0)); b_keyok[72]=false; } else if(pMsg->wParam==123)//F10 { m_Label_Key[73].SetBkColor(RGB(255, 255, 0)); b_keyok[73]=false; } else if(pMsg->wParam==122)//F12 { m_Label_Key[76].SetBkColor(RGB(255, 255, 0)); b_keyok[76]=false; } else if(pMsg->wParam==46) { m_Label_Key[74].SetBkColor(RGB(255, 255, 0)); b_keyok[74]=false; } else if(pMsg->wParam==132)//F12 { m_Label_Key[77].SetBkColor(RGB(255, 255, 0)); b_keyok[77]=false; } else if(pMsg->wParam==119) { m_Label_Key[75].SetBkColor(RGB(255, 255, 0)); b_keyok[75]=false; } /* else if(pMsg->wParam==124)//FnLock { m_Label_Key[70].SetBkColor(RGB(255, 255, 0)); b_keyok[70]=false; } else if(pMsg->wParam==112)//F1 { m_Label_Key[71].SetBkColor(RGB(255, 255, 0)); b_keyok[71]=false; } else if(pMsg->wParam==113)//F2 { m_Label_Key[72].SetBkColor(RGB(255, 255, 0)); b_keyok[72]=false; } else if(pMsg->wParam==114)//F3 { m_Label_Key[73].SetBkColor(RGB(255, 255, 0)); b_keyok[73]=false; } else if(pMsg->wParam==115)//F4 { m_Label_Key[74].SetBkColor(RGB(255, 255, 0)); b_keyok[74]=false; } else if(pMsg->wParam==116)//F5 { m_Label_Key[75].SetBkColor(RGB(255, 255, 0)); b_keyok[75]=false; } else if(pMsg->wParam==117)//F6 { m_Label_Key[76].SetBkColor(RGB(255, 255, 0)); b_keyok[76]=false; } else if(pMsg->wParam==118)//F7 { m_Label_Key[77].SetBkColor(RGB(255, 255, 0)); b_keyok[77]=false; } else if(pMsg->wParam==44)//F8 { m_Label_Key[78].SetBkColor(RGB(255, 255, 0)); b_keyok[78]=false; } else if(pMsg->wParam==120)//F9 { m_Label_Key[79].SetBkColor(RGB(255, 255, 0)); b_keyok[79]=false; } else if(pMsg->wParam==121)//F10 { m_Label_Key[80].SetBkColor(RGB(255, 255, 0)); b_keyok[80]=false; } else if(pMsg->wParam==122)//F11 { m_Label_Key[81].SetBkColor(RGB(255, 255, 0)); b_keyok[81]=false; } else if(pMsg->wParam==123)//F12 { m_Label_Key[82].SetBkColor(RGB(255, 255, 0)); b_keyok[82]=false; } else if(pMsg->wParam==125)//APPP1 PrtSc { m_Label_Key[83].SetBkColor(RGB(255, 255, 0)); b_keyok[83]=false; } else if(pMsg->wParam==126)//APP2 Insert { m_Label_Key[84].SetBkColor(RGB(255, 255, 0)); b_keyok[84]=false; } else if(pMsg->wParam==46)//Delete { m_Label_Key[85].SetBkColor(RGB(255, 255, 0)); b_keyok[85]=false; } */ return TRUE; } } else { HWND hwnd = ::GetFocus(); int iID = ::GetDlgCtrlID(hwnd); if (pMsg->message == WM_KEYDOWN) { if (pMsg->wParam == VK_ESCAPE) return TRUE; // 防止按回车键后,非法退出的问题 if(iID != IDC_EDIT1_IntputSN && iID != IDC_InputVersion && iID !=IDC_EDIT_Comport&&iID!=IDC_EDIT_PASStimes&&iID!=IDC_EDIT_FailTimes&& iID != IDC_EDIT1_BT/*&& iID !=IDC_EDIT_KeyPadVersion && iID !=IDC_EDIT_WirelessChgVersion && iID !=IDC_EDIT_BT*/) return TRUE; if (pMsg->wParam ==VK_RETURN) { if(IDC_EDIT1_IntputSN == iID) { OnBnClickedButton1(); return TRUE; }else { return TRUE; } } } } return CDialogEx::PreTranslateMessage(pMsg); } 在 MFC 中实现汽车遥控器 UI,特别是需要圆形/椭圆形按钮且支持按下/抬起状态变化,需要在这里设置键值
06-23
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值